esprima
esprima copied to clipboard
ECMAScript parsing infrastructure for multipurpose analysis
By publishing the ES5 in `lib` and ES2015 and `lib.es2015` to npm, the esprima library can be directly referenced leading to more control over what ends up in a output...
AST generation works fine but tokenization fails. ### Steps to reproduce ```js esprima.tokenize('var m = a++/ b;') ``` ### Expected output Error should not be thrown ### Actual output 'Invalid...
Unexpected token ILLEGAL on /^ I try parse following js isImage=function(e){return/^image\//.test(e.type) and get ParserExeption Line 1: Unexpected token ILLEGAL This code works in chrome without any errors. Code to parse...
BigInt literals like `1n`, `10n` fail. However, `BigInt(1)`, `BigInt(10)` pass. ### Steps to reproduce Below are both `Fail code` that throws the error, and converted code `Pass code` that passes....
### Steps to reproduce ```js // okay export default [...foo, ...bar] // not okay export default [].concat(foo) ^ ``` The bottom example is how the Buble compiler transforms something like...
Now that GitHub provides a built-in and well-integrated CI solution in the form of GitHub Actions which supports all platforms (Windows, macOS, Linux), it does make sense to stop using...
I have a comment inside the function definition. So adding that as a trailing comment for that node seems to be correct. But the same comments are added as a...
### Steps to reproduce ```js esprima.parse('', { jsx: true }) ``` ### Expected output ```jsonc // excludes location information for brevity { "type": "Program", "body": [ { "type": "ExpressionStatement", "expression":...
### Steps to reproduce ```js esprima.parseScript('if (foo) { return 5; } else { return 6; }'); ``` I would like to be able to successfully parse this without an `Illegal...
(to be written) References: - The proposal: https://tc39.github.io/proposal-template-literal-revision/ - Change to the spec: ? - ESTree for ES2017: https://github.com/estree/estree/blob/master/es2017.md