esprima icon indicating copy to clipboard operation
esprima copied to clipboard

Async binding & destructuring issues

Open KFlash opened this issue 7 years ago • 0 comments

After experimenting with Esprima I come across a lot of binding & destructuring issues. Cases that actually should fail, but doesn't.

I used the ASTExplorer to verify this.

Steps to reproduce


 // parenthesized

esprima.parse('async ((x, y, z)) => 0 ')

// nested
esprima.parse('async(async(async(async(async(async())))))')

 // others
esprima.parse('async(a)(s)(y)(n)(c)')
esprima.parse('async (async ()  => a)  => a')
esprima.parse('async(async() () => {})(async() () => {})(y)(n)(c)')
esprima.parse('async().foo13 () => 1')
esprima.parse('async(async() () => {})(async() () => {})(async() () => {})(async() () => {})(async() () => {})')
esprima.parse('async().foo13 () => 1')
esprima.parse('async()(async() => {})')

Expected output

This cases should all throw an syntax error

Actual output

Parses as normal, and doesn't throw any errors

Relevant references

V8, Acorn, Test262 among others

KFlash avatar Jun 23 '18 21:06 KFlash