In Chrome 63.0 and Firefox 58.0, it appears that adding an index to an object literal prevents the object from being parsed as an object.
{"a":"b"}
17:37:32.246 {a: "b"}
{"a":"b"}["a"]
17:37:36.578 VM288:1 Uncaught SyntaxError: Unexpected token :
Can anybody explain why the parser doesn't parse this the way I do? (I think there must be a bug in my implementation of the spec...) It seems to think it's not parsing an object.
Surrounding the object in brackets results in syntactically correct expression:
({"a":"b"})["a"]
17:42:03.993 "b"