mozilla / scanjs

[DEPRECATED] Static analysis tool for javascript code.
Other
429 stars 39 forks source link

Destructuring assignment fails with SyntaxError/Unexpected token. #131

Closed nmaier closed 10 years ago

nmaier commented 10 years ago

Put the following code in a file and scan.

var t = {a:1};
var {a} = t; // SyntaxError here

The parser fails with SyntaxError/Unexpected token in line 2.

mozfreddyb commented 10 years ago

Sadly, this is not supported by our JS parsing library acorn, see #9. Something I wanted to fix upstream, but haven't yet... :|