Warning: Do not mistake any
with mixed
. Read more
If you want a way to opt-out of using the type checker, any
is the way to do
it. Using any
is completely unsafe, and should be avoided whenever
possible.
For example, the following code will not report any errors:
1
2
3
4
5
6
7
8
|
function add(one: any, two: any): number {
return one + two;
}
add(1, 2);
add("1", "2");
add({}, []);
|
{"value":"// @flow\nfunction add(one: any, two: any): number {\n return one + two;\n}\n\nadd(1, 2); // Works.\nadd(\"1\", \"2\"); // Works.\nadd({}, []); // Works.\n","tokens":[{"type":"Line","context":"comment","value":"// @flow","line":1,"start":0,"end":8},{"type":"T_FUNCTION","context":"normal","value":"function","line":2,"start":9,"end":17},{"type":"T_IDENTIFIER","context":"normal","value":"add","line":2,"start":18,"end":21},{"type":"T_LPAREN","context":"normal","value":"(","line":2,"start":21,"end":22},{"type":"T_IDENTIFIER","context":"normal","value":"one","line":2,"start":22,"end":25},{"type":"T_COLON","context":"type","value":":","line":2,"start":25,"end":26},{"type":"T_ANY_TYPE","context":"type","value":"any","line":2,"start":27,"end":30},{"type":"T_COMMA","context":"normal","value":",","line":2,"start":30,"end":31},{"type":"T_IDENTIFIER","context":"normal","value":"two","line":2,"start":32,"end":35},{"type":"T_COLON","context":"type","value":":","line":2,"start":35,"end":36},{"type":"T_ANY_TYPE","context":"type","value":"any","line":2,"start":37,"end":40},{"type":"T_RPAREN","context":"normal","value":")","line":2,"start":40,"end":41},{"type":"T_COLON","context":"type","value":":","line":2,"start":41,"end":42},{"type":"T_NUMBER_TYPE","context":"type","value":"number","line":2,"start":43,"end":49},{"type":"T_LCURLY","context":"normal","value":"{","line":2,"start":50,"end":51},{"type":"T_RETURN","context":"normal","value":"return","line":3,"start":54,"end":60},{"type":"T_IDENTIFIER","context":"normal","value":"one","line":3,"start":61,"end":64},{"type":"T_PLUS","context":"normal","value":"+","line":3,"start":65,"end":66},{"type":"T_IDENTIFIER","context":"normal","value":"two","line":3,"start":67,"end":70},{"type":"T_SEMICOLON","context":"normal","value":";","line":3,"start":70,"end":71},{"type":"T_RCURLY","context":"normal","value":"}","line":4,"start":72,"end":73},{"type":"T_IDENTIFIER","context":"normal","value":"add","line":6,"start":75,"end":78},{"type":"T_LPAREN","context":"normal","value":"(","line":6,"start":78,"end":79},{"type":"T_NUMBER","context":"normal","value":"1","line":6,"start":79,"end":80},{"type":"T_COMMA","context":"normal","value":",","line":6,"start":80,"end":81},{"type":"T_NUMBER","context":"normal","value":"2","line":6,"start":82,"end":83},{"type":"T_RPAREN","context":"normal","value":")","line":6,"start":83,"end":84},{"type":"T_SEMICOLON","context":"normal","value":";","line":6,"start":84,"end":85},{"type":"Line","context":"comment","value":"// Works.","line":6,"start":90,"end":99},{"type":"T_IDENTIFIER","context":"normal","value":"add","line":7,"start":100,"end":103},{"type":"T_LPAREN","context":"normal","value":"(","line":7,"start":103,"end":104},{"type":"T_STRING","context":"normal","value":"\"1\"","line":7,"start":104,"end":107},{"type":"T_COMMA","context":"normal","value":",","line":7,"start":107,"end":108},{"type":"T_STRING","context":"normal","value":"\"2\"","line":7,"start":109,"end":112},{"type":"T_RPAREN","context":"normal","value":")","line":7,"start":112,"end":113},{"type":"T_SEMICOLON","context":"normal","value":";","line":7,"start":113,"end":114},{"type":"Line","context":"comment","value":"// Works.","line":7,"start":115,"end":124},{"type":"T_IDENTIFIER","context":"normal","value":"add","line":8,"start":125,"end":128},{"type":"T_LPAREN","context":"normal","value":"(","line":8,"start":128,"end":129},{"type":"T_LCURLY","context":"normal","value":"{","line":8,"start":129,"end":130},{"type":"T_RCURLY","context":"normal","value":"}","line":8,"start":130,"end":131},{"type":"T_COMMA","context":"normal","value":",","line":8,"start":131,"end":132},{"type":"T_LBRACKET","context":"normal","value":"[","line":8,"start":133,"end":134},{"type":"T_RBRACKET","context":"normal","value":"]","line":8,"start":134,"end":135},{"type":"T_RPAREN","context":"normal","value":")","line":8,"start":135,"end":136},{"type":"T_SEMICOLON","context":"normal","value":";","line":8,"start":136,"end":137},{"type":"Line","context":"comment","value":"// Works.","line":8,"start":140,"end":149}],"errors":[]}
Even code that will cause runtime errors will not be caught by Flow:
1
2
3
4
5
6
|
function getNestedProperty(obj: any) {
return obj.foo.bar.baz;
}
getNestedProperty({});
|
{"value":"// @flow\nfunction getNestedProperty(obj: any) {\n return obj.foo.bar.baz;\n}\n\ngetNestedProperty({});\n","tokens":[{"type":"Line","context":"comment","value":"// @flow","line":1,"start":0,"end":8},{"type":"T_FUNCTION","context":"normal","value":"function","line":2,"start":9,"end":17},{"type":"T_IDENTIFIER","context":"normal","value":"getNestedProperty","line":2,"start":18,"end":35},{"type":"T_LPAREN","context":"normal","value":"(","line":2,"start":35,"end":36},{"type":"T_IDENTIFIER","context":"normal","value":"obj","line":2,"start":36,"end":39},{"type":"T_COLON","context":"type","value":":","line":2,"start":39,"end":40},{"type":"T_ANY_TYPE","context":"type","value":"any","line":2,"start":41,"end":44},{"type":"T_RPAREN","context":"normal","value":")","line":2,"start":44,"end":45},{"type":"T_LCURLY","context":"normal","value":"{","line":2,"start":46,"end":47},{"type":"T_RETURN","context":"normal","value":"return","line":3,"start":50,"end":56},{"type":"T_IDENTIFIER","context":"normal","value":"obj","line":3,"start":57,"end":60},{"type":"T_PERIOD","context":"normal","value":".","line":3,"start":60,"end":61},{"type":"T_IDENTIFIER","context":"normal","value":"foo","line":3,"start":61,"end":64},{"type":"T_PERIOD","context":"normal","value":".","line":3,"start":64,"end":65},{"type":"T_IDENTIFIER","context":"normal","value":"bar","line":3,"start":65,"end":68},{"type":"T_PERIOD","context":"normal","value":".","line":3,"start":68,"end":69},{"type":"T_IDENTIFIER","context":"normal","value":"baz","line":3,"start":69,"end":72},{"type":"T_SEMICOLON","context":"normal","value":";","line":3,"start":72,"end":73},{"type":"T_RCURLY","context":"normal","value":"}","line":4,"start":74,"end":75},{"type":"T_IDENTIFIER","context":"normal","value":"getNestedProperty","line":6,"start":77,"end":94},{"type":"T_LPAREN","context":"normal","value":"(","line":6,"start":94,"end":95},{"type":"T_LCURLY","context":"normal","value":"{","line":6,"start":95,"end":96},{"type":"T_RCURLY","context":"normal","value":"}","line":6,"start":96,"end":97},{"type":"T_RPAREN","context":"normal","value":")","line":6,"start":97,"end":98},{"type":"T_SEMICOLON","context":"normal","value":";","line":6,"start":98,"end":99}],"errors":[]}
There are only a couple of scenarios where you might consider using any
:
- When you are in the process of converting existing code to using Flow
types and you are currently blocked on having the code type checked (maybe
other code needs to be converted first).
- When you are certain your code works and for some reason Flow is unable to
type check it correctly. There are a (decreasing) number of idioms in
JavaScript that Flow is unable to statically type.
Avoid leaking any
When you have a value with the type any
, you can cause Flow to infer any
for the results of all of the operations you perform.
For example, if you get a property on an object typed any
, the resulting
value will also have the type any
.
1
2
3
4
|
function fn(obj: any) {
let foo = obj.foo;
}
|
{"value":"// @flow\nfunction fn(obj: any) {\n let foo /* (:any) */ = obj.foo;\n}\n","tokens":[{"type":"Line","context":"comment","value":"// @flow","line":1,"start":0,"end":8},{"type":"T_FUNCTION","context":"normal","value":"function","line":2,"start":9,"end":17},{"type":"T_IDENTIFIER","context":"normal","value":"fn","line":2,"start":18,"end":20},{"type":"T_LPAREN","context":"normal","value":"(","line":2,"start":20,"end":21},{"type":"T_IDENTIFIER","context":"normal","value":"obj","line":2,"start":21,"end":24},{"type":"T_COLON","context":"type","value":":","line":2,"start":24,"end":25},{"type":"T_ANY_TYPE","context":"type","value":"any","line":2,"start":26,"end":29},{"type":"T_RPAREN","context":"normal","value":")","line":2,"start":29,"end":30},{"type":"T_LCURLY","context":"normal","value":"{","line":2,"start":31,"end":32},{"type":"T_LET","context":"normal","value":"let","line":3,"start":35,"end":38},{"type":"T_IDENTIFIER","context":"normal","value":"foo","line":3,"start":39,"end":42},{"type":"Block","context":"comment","value":"/* (:any) */","line":3,"start":43,"end":55},{"type":"T_ASSIGN","context":"normal","value":"=","line":3,"start":56,"end":57},{"type":"T_IDENTIFIER","context":"normal","value":"obj","line":3,"start":58,"end":61},{"type":"T_PERIOD","context":"normal","value":".","line":3,"start":61,"end":62},{"type":"T_IDENTIFIER","context":"normal","value":"foo","line":3,"start":62,"end":65},{"type":"T_SEMICOLON","context":"normal","value":";","line":3,"start":65,"end":66},{"type":"T_RCURLY","context":"normal","value":"}","line":4,"start":67,"end":68}],"errors":[]}
You could then use the resulting value in another operation, such as adding it
as if it were a number and the result will also be any
.
1
2
3
4
5
|
function fn(obj: any) {
let foo = obj.foo;
let bar = foo * 2;
}
|
{"value":"// @flow\nfunction fn(obj: any) {\n let foo /* (:any) */ = obj.foo;\n let bar /* (:any) */ = foo * 2;\n}\n","tokens":[{"type":"Line","context":"comment","value":"// @flow","line":1,"start":0,"end":8},{"type":"T_FUNCTION","context":"normal","value":"function","line":2,"start":9,"end":17},{"type":"T_IDENTIFIER","context":"normal","value":"fn","line":2,"start":18,"end":20},{"type":"T_LPAREN","context":"normal","value":"(","line":2,"start":20,"end":21},{"type":"T_IDENTIFIER","context":"normal","value":"obj","line":2,"start":21,"end":24},{"type":"T_COLON","context":"type","value":":","line":2,"start":24,"end":25},{"type":"T_ANY_TYPE","context":"type","value":"any","line":2,"start":26,"end":29},{"type":"T_RPAREN","context":"normal","value":")","line":2,"start":29,"end":30},{"type":"T_LCURLY","context":"normal","value":"{","line":2,"start":31,"end":32},{"type":"T_LET","context":"normal","value":"let","line":3,"start":35,"end":38},{"type":"T_IDENTIFIER","context":"normal","value":"foo","line":3,"start":39,"end":42},{"type":"Block","context":"comment","value":"/* (:any) */","line":3,"start":43,"end":55},{"type":"T_ASSIGN","context":"normal","value":"=","line":3,"start":56,"end":57},{"type":"T_IDENTIFIER","context":"normal","value":"obj","line":3,"start":58,"end":61},{"type":"T_PERIOD","context":"normal","value":".","line":3,"start":61,"end":62},{"type":"T_IDENTIFIER","context":"normal","value":"foo","line":3,"start":62,"end":65},{"type":"T_SEMICOLON","context":"normal","value":";","line":3,"start":65,"end":66},{"type":"T_LET","context":"normal","value":"let","line":4,"start":69,"end":72},{"type":"T_IDENTIFIER","context":"normal","value":"bar","line":4,"start":73,"end":76},{"type":"Block","context":"comment","value":"/* (:any) */","line":4,"start":77,"end":89},{"type":"T_ASSIGN","context":"normal","value":"=","line":4,"start":90,"end":91},{"type":"T_IDENTIFIER","context":"normal","value":"foo","line":4,"start":92,"end":95},{"type":"T_MULT","context":"normal","value":"*","line":4,"start":96,"end":97},{"type":"T_NUMBER","context":"normal","value":"2","line":4,"start":98,"end":99},{"type":"T_SEMICOLON","context":"normal","value":";","line":4,"start":99,"end":100},{"type":"T_RCURLY","context":"normal","value":"}","line":5,"start":101,"end":102}],"errors":[]}
You could continue this process until any
has leaked all over your code.
1
2
3
4
5
6
7
8
9
|
function fn(obj: any) {
let foo = obj.foo;
let bar = foo * 2;
return bar;
}
let bar = fn({ foo: 2 });
let baz = "baz:" + bar;
|
{"value":"// @flow\nfunction fn(obj: any) /* (:any) */ {\n let foo /* (:any) */ = obj.foo;\n let bar /* (:any) */ = foo * 2;\n return bar;\n}\n\nlet bar /* (:any) */ = fn({ foo: 2 });\nlet baz /* (:any) */ = \"baz:\" + bar;\n","tokens":[{"type":"Line","context":"comment","value":"// @flow","line":1,"start":0,"end":8},{"type":"T_FUNCTION","context":"normal","value":"function","line":2,"start":9,"end":17},{"type":"T_IDENTIFIER","context":"normal","value":"fn","line":2,"start":18,"end":20},{"type":"T_LPAREN","context":"normal","value":"(","line":2,"start":20,"end":21},{"type":"T_IDENTIFIER","context":"normal","value":"obj","line":2,"start":21,"end":24},{"type":"T_COLON","context":"type","value":":","line":2,"start":24,"end":25},{"type":"T_ANY_TYPE","context":"type","value":"any","line":2,"start":26,"end":29},{"type":"T_RPAREN","context":"normal","value":")","line":2,"start":29,"end":30},{"type":"Block","context":"comment","value":"/* (:any) */","line":2,"start":31,"end":43},{"type":"T_LCURLY","context":"normal","value":"{","line":2,"start":44,"end":45},{"type":"T_LET","context":"normal","value":"let","line":3,"start":48,"end":51},{"type":"T_IDENTIFIER","context":"normal","value":"foo","line":3,"start":52,"end":55},{"type":"Block","context":"comment","value":"/* (:any) */","line":3,"start":56,"end":68},{"type":"T_ASSIGN","context":"normal","value":"=","line":3,"start":69,"end":70},{"type":"T_IDENTIFIER","context":"normal","value":"obj","line":3,"start":71,"end":74},{"type":"T_PERIOD","context":"normal","value":".","line":3,"start":74,"end":75},{"type":"T_IDENTIFIER","context":"normal","value":"foo","line":3,"start":75,"end":78},{"type":"T_SEMICOLON","context":"normal","value":";","line":3,"start":78,"end":79},{"type":"T_LET","context":"normal","value":"let","line":4,"start":82,"end":85},{"type":"T_IDENTIFIER","context":"normal","value":"bar","line":4,"start":86,"end":89},{"type":"Block","context":"comment","value":"/* (:any) */","line":4,"start":90,"end":102},{"type":"T_ASSIGN","context":"normal","value":"=","line":4,"start":103,"end":104},{"type":"T_IDENTIFIER","context":"normal","value":"foo","line":4,"start":105,"end":108},{"type":"T_MULT","context":"normal","value":"*","line":4,"start":109,"end":110},{"type":"T_NUMBER","context":"normal","value":"2","line":4,"start":111,"end":112},{"type":"T_SEMICOLON","context":"normal","value":";","line":4,"start":112,"end":113},{"type":"T_RETURN","context":"normal","value":"return","line":5,"start":116,"end":122},{"type":"T_IDENTIFIER","context":"normal","value":"bar","line":5,"start":123,"end":126},{"type":"T_SEMICOLON","context":"normal","value":";","line":5,"start":126,"end":127},{"type":"T_RCURLY","context":"normal","value":"}","line":6,"start":128,"end":129},{"type":"T_LET","context":"normal","value":"let","line":8,"start":131,"end":134},{"type":"T_IDENTIFIER","context":"normal","value":"bar","line":8,"start":135,"end":138},{"type":"Block","context":"comment","value":"/* (:any) */","line":8,"start":139,"end":151},{"type":"T_ASSIGN","context":"normal","value":"=","line":8,"start":152,"end":153},{"type":"T_IDENTIFIER","context":"normal","value":"fn","line":8,"start":154,"end":156},{"type":"T_LPAREN","context":"normal","value":"(","line":8,"start":156,"end":157},{"type":"T_LCURLY","context":"normal","value":"{","line":8,"start":157,"end":158},{"type":"T_IDENTIFIER","context":"normal","value":"foo","line":8,"start":159,"end":162},{"type":"T_COLON","context":"normal","value":":","line":8,"start":162,"end":163},{"type":"T_NUMBER","context":"normal","value":"2","line":8,"start":164,"end":165},{"type":"T_RCURLY","context":"normal","value":"}","line":8,"start":166,"end":167},{"type":"T_RPAREN","context":"normal","value":")","line":8,"start":167,"end":168},{"type":"T_SEMICOLON","context":"normal","value":";","line":8,"start":168,"end":169},{"type":"T_LET","context":"normal","value":"let","line":9,"start":170,"end":173},{"type":"T_IDENTIFIER","context":"normal","value":"baz","line":9,"start":174,"end":177},{"type":"Block","context":"comment","value":"/* (:any) */","line":9,"start":178,"end":190},{"type":"T_ASSIGN","context":"normal","value":"=","line":9,"start":191,"end":192},{"type":"T_STRING","context":"normal","value":"\"baz:\"","line":9,"start":193,"end":199},{"type":"T_PLUS","context":"normal","value":"+","line":9,"start":200,"end":201},{"type":"T_IDENTIFIER","context":"normal","value":"bar","line":9,"start":202,"end":205},{"type":"T_SEMICOLON","context":"normal","value":";","line":9,"start":205,"end":206}],"errors":[]}
Prevent this from happening by cutting any
off as soon as possible by casting
it to another type.
1
2
3
4
|
function fn(obj: any) {
let foo: number = obj.foo;
}
|
{"value":"// @flow\nfunction fn(obj: any) {\n let foo: number = obj.foo;\n}\n","tokens":[{"type":"Line","context":"comment","value":"// @flow","line":1,"start":0,"end":8},{"type":"T_FUNCTION","context":"normal","value":"function","line":2,"start":9,"end":17},{"type":"T_IDENTIFIER","context":"normal","value":"fn","line":2,"start":18,"end":20},{"type":"T_LPAREN","context":"normal","value":"(","line":2,"start":20,"end":21},{"type":"T_IDENTIFIER","context":"normal","value":"obj","line":2,"start":21,"end":24},{"type":"T_COLON","context":"type","value":":","line":2,"start":24,"end":25},{"type":"T_ANY_TYPE","context":"type","value":"any","line":2,"start":26,"end":29},{"type":"T_RPAREN","context":"normal","value":")","line":2,"start":29,"end":30},{"type":"T_LCURLY","context":"normal","value":"{","line":2,"start":31,"end":32},{"type":"T_LET","context":"normal","value":"let","line":3,"start":35,"end":38},{"type":"T_IDENTIFIER","context":"normal","value":"foo","line":3,"start":39,"end":42},{"type":"T_COLON","context":"type","value":":","line":3,"start":42,"end":43},{"type":"T_NUMBER_TYPE","context":"type","value":"number","line":3,"start":44,"end":50},{"type":"T_ASSIGN","context":"normal","value":"=","line":3,"start":51,"end":52},{"type":"T_IDENTIFIER","context":"normal","value":"obj","line":3,"start":53,"end":56},{"type":"T_PERIOD","context":"normal","value":".","line":3,"start":56,"end":57},{"type":"T_IDENTIFIER","context":"normal","value":"foo","line":3,"start":57,"end":60},{"type":"T_SEMICOLON","context":"normal","value":";","line":3,"start":60,"end":61},{"type":"T_RCURLY","context":"normal","value":"}","line":4,"start":62,"end":63}],"errors":[]}
Now your code will not leak any
.
1
2
3
4
5
6
7
8
9
|
function fn(obj: any) {
let foo: number = obj.foo;
let bar = foo * 2;
return bar;
}
let bar = fn({ foo: 2 });
let baz = "baz:" + bar;
|
{"value":"// @flow\nfunction fn(obj: any) /* (:number) */ {\n let foo: number = obj.foo;\n let bar /* (:number) */ = foo * 2;\n return bar;\n}\n\nlet bar /* (:number) */ = fn({ foo: 2 });\nlet baz /* (:string) */ = \"baz:\" + bar;\n","tokens":[{"type":"Line","context":"comment","value":"// @flow","line":1,"start":0,"end":8},{"type":"T_FUNCTION","context":"normal","value":"function","line":2,"start":9,"end":17},{"type":"T_IDENTIFIER","context":"normal","value":"fn","line":2,"start":18,"end":20},{"type":"T_LPAREN","context":"normal","value":"(","line":2,"start":20,"end":21},{"type":"T_IDENTIFIER","context":"normal","value":"obj","line":2,"start":21,"end":24},{"type":"T_COLON","context":"type","value":":","line":2,"start":24,"end":25},{"type":"T_ANY_TYPE","context":"type","value":"any","line":2,"start":26,"end":29},{"type":"T_RPAREN","context":"normal","value":")","line":2,"start":29,"end":30},{"type":"Block","context":"comment","value":"/* (:number) */","line":2,"start":31,"end":46},{"type":"T_LCURLY","context":"normal","value":"{","line":2,"start":47,"end":48},{"type":"T_LET","context":"normal","value":"let","line":3,"start":51,"end":54},{"type":"T_IDENTIFIER","context":"normal","value":"foo","line":3,"start":55,"end":58},{"type":"T_COLON","context":"type","value":":","line":3,"start":58,"end":59},{"type":"T_NUMBER_TYPE","context":"type","value":"number","line":3,"start":60,"end":66},{"type":"T_ASSIGN","context":"normal","value":"=","line":3,"start":67,"end":68},{"type":"T_IDENTIFIER","context":"normal","value":"obj","line":3,"start":69,"end":72},{"type":"T_PERIOD","context":"normal","value":".","line":3,"start":72,"end":73},{"type":"T_IDENTIFIER","context":"normal","value":"foo","line":3,"start":73,"end":76},{"type":"T_SEMICOLON","context":"normal","value":";","line":3,"start":76,"end":77},{"type":"T_LET","context":"normal","value":"let","line":4,"start":80,"end":83},{"type":"T_IDENTIFIER","context":"normal","value":"bar","line":4,"start":84,"end":87},{"type":"Block","context":"comment","value":"/* (:number) */","line":4,"start":88,"end":103},{"type":"T_ASSIGN","context":"normal","value":"=","line":4,"start":104,"end":105},{"type":"T_IDENTIFIER","context":"normal","value":"foo","line":4,"start":106,"end":109},{"type":"T_MULT","context":"normal","value":"*","line":4,"start":110,"end":111},{"type":"T_NUMBER","context":"normal","value":"2","line":4,"start":112,"end":113},{"type":"T_SEMICOLON","context":"normal","value":";","line":4,"start":113,"end":114},{"type":"T_RETURN","context":"normal","value":"return","line":5,"start":117,"end":123},{"type":"T_IDENTIFIER","context":"normal","value":"bar","line":5,"start":124,"end":127},{"type":"T_SEMICOLON","context":"normal","value":";","line":5,"start":127,"end":128},{"type":"T_RCURLY","context":"normal","value":"}","line":6,"start":129,"end":130},{"type":"T_LET","context":"normal","value":"let","line":8,"start":132,"end":135},{"type":"T_IDENTIFIER","context":"normal","value":"bar","line":8,"start":136,"end":139},{"type":"Block","context":"comment","value":"/* (:number) */","line":8,"start":140,"end":155},{"type":"T_ASSIGN","context":"normal","value":"=","line":8,"start":156,"end":157},{"type":"T_IDENTIFIER","context":"normal","value":"fn","line":8,"start":158,"end":160},{"type":"T_LPAREN","context":"normal","value":"(","line":8,"start":160,"end":161},{"type":"T_LCURLY","context":"normal","value":"{","line":8,"start":161,"end":162},{"type":"T_IDENTIFIER","context":"normal","value":"foo","line":8,"start":163,"end":166},{"type":"T_COLON","context":"normal","value":":","line":8,"start":166,"end":167},{"type":"T_NUMBER","context":"normal","value":"2","line":8,"start":168,"end":169},{"type":"T_RCURLY","context":"normal","value":"}","line":8,"start":170,"end":171},{"type":"T_RPAREN","context":"normal","value":")","line":8,"start":171,"end":172},{"type":"T_SEMICOLON","context":"normal","value":";","line":8,"start":172,"end":173},{"type":"T_LET","context":"normal","value":"let","line":9,"start":174,"end":177},{"type":"T_IDENTIFIER","context":"normal","value":"baz","line":9,"start":178,"end":181},{"type":"Block","context":"comment","value":"/* (:string) */","line":9,"start":182,"end":197},{"type":"T_ASSIGN","context":"normal","value":"=","line":9,"start":198,"end":199},{"type":"T_STRING","context":"normal","value":"\"baz:\"","line":9,"start":200,"end":206},{"type":"T_PLUS","context":"normal","value":"+","line":9,"start":207,"end":208},{"type":"T_IDENTIFIER","context":"normal","value":"bar","line":9,"start":209,"end":212},{"type":"T_SEMICOLON","context":"normal","value":";","line":9,"start":212,"end":213}],"errors":[]}