esprima
esprima copied to clipboard
Async binding & destructuring issues
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