(cc-ing dev.tech.js-engine.internals)

On 07/10/2014 05:07 PM, Marcell Vazquez-Chanlatte wrote:
Hey, I was told you were someone who might care if there is a bug in the Parser 
API wiki or the parser.

Specifically, for the LetStatement in the parser api 
(https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Parser_API)
This Wiki says,
head: [ { id: Pattern, init: Expression | null } ];

but Reflect.parse("for(let x=2;;){}") returns a LetStatement with a list of 
VariableDeclarators.
This is not strictly equivilent because of the type and loc fields.

Yeah, this is really *really* gross. Currently our parser mangles that for-statement into this:

    let (x=2) for(;;){}

This is an example of a Reflect.parse bug around 'let' that's actually a bug in the JS engine itself. The parser's current behavior predates ES6 'let' by several years. I hope these will be steadily fixed as we start upgrading our support for 'let' to the ES6 standard. Shu-yu Guo and Nathan Braswell have been working on that, but for(let;;) support is probably a little further off.

Thanks for the simple test case! However **please** report any bugs via Bugzilla, and tell your friends & coworkers to do the same -- I almost missed this email entirely.

Cheers,
-j
_______________________________________________
dev-tech-js-engine-internals mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to