google-code-export / esprima

Automatically exported from code.google.com/p/esprima
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

harmony branch confuses the string '[' with a computed property #589

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Code:

    ({ '[': 42 })

The string '[' is confused with an ES6 computed property so running the 
resulting AST through escodegen gives:

    ({ ['[']: 42 })

I've got a fix for this and will open a PR.

Original issue reported on code.google.com by tim.dis...@gmail.com on 13 Sep 2014 at 2:05

GoogleCodeExporter commented 9 years ago
computed properties start with a punctuator
https://github.com/ariya/esprima/commit/54f49ada87

Original comment by ariya.hi...@gmail.com on 14 Feb 2015 at 9:57