esprima
esprima copied to clipboard
ECMAScript parsing infrastructure for multipurpose analysis
Specs says: "*It is a Syntax Error if IsValidSimpleAssignmentTarget of IdentifierReference is false*" ### Steps to reproduce ```js esprima.parse('"use strict"; 1, { arguments } = [];') ``` ### Expected output...
### Steps to reproduce ```js esprima.parse(''use strict'; [...eval] = a') ``` ### Expected output Should throw ### Actual output Parses an invalid AST node
### Steps to reproduce ```js esprima.parse('with(1) b: function a(){}') ``` ### Expected output Should throw ### Actual output Parses invalid AST node
### Steps to reproduce ```js esprima.parse('a: { continue a; }') esprima.parse('a: continue a; ') ``` ### Expected output Should throw an error ### Actual output Parses invalid AST node
Esprima accepts invalid nested parenthesized pattern. ### Steps to reproduce ```js esprima.parse('({ src: ([dest]) } = obj)') ``` ### Expected output Throws an error ### Actual output Outputs invalid AST
Doesn't fail on yield as parameter in sloppy mode. Does fail for strict mode, but the error message in strict mode seems to be out of context. ### Steps to...
Any plans to implement support for JSX fragments?
This is for both import and export. And here is one [TC-39 reference](https://github.com/tc39/test262/blob/master/test/language/export/escaped-as-export-specifier.js) showing the issue. ### Steps to reproduce ```js esprima.parse('export {a \\u0061s b} from "./foo.js";') ``` ### Expected...
Generator declaration not allowed in statement position ### Steps to reproduce ```js esprima.parse('label: function* g() {}') ``` ### Expected output Throw an error ### Actual output Parses invalid AST
### Steps to reproduce ```js esprima.parse('if(1)class A{}') ``` ### Expected output Should throw an error ### Actual output Outputs an AST tree