Tags: acornjs/acorn
Tags
Version 8.17.0 ### New features The new `strict` option can be used to start script sources in strict mode. ### Bug fixes Fix a number of corner case bugs when `using` or `await using` appear in `for` loop specs. Disallow `new super()` expressions. Don't allow the conditional in a ternary expression to be a (naked) arrow function.
Version 8.16.0 ### New features The `sourceType` option can now be set to `"commonjs"` to have the parser treat the top level scope as a function scope. Add support for Unicode 17. ### Bug fixes Don't recognize `await using` as contextual keywords when followed directly by a backslash. Fix an issue where the parser would allow `return` statements in `static` blocks when `allowReturnOutsideFunction` was enabled. Properly reject `using` declarations that appear directly in `switch` or `for` head scopes. Fix some corner case issues in the recognition of `using` syntax.
Version 8.15.0 ### New features Support `using` and `await using` syntax. The `AnyNode` type is now defined in such a way that plugins can extend it. ### Bug fixes Fix an issue where the `bigint` property of literal nodes for non-decimal bigints had the wrong format. The `acorn` CLI tool no longer crashes when emitting a tree that contains a bigint.
Version 8.14.1 ### Bug fixes Fix an issue where `await` expressions in class field initializers were inappropriately allowed. Properly allow await inside an async arrow function inside a class field initializer. Mention the source file name in syntax error messages when given. Properly add an empty `attributes` property to every form of `ExportNamedDeclaration`.
Version 8.12.0
### New features
Support ES2025 duplicate capture group names in regular expressions.
### Bug fixes
Include `VariableDeclarator` in the `AnyNode` type so that walker objects can refer to it without getting a type error.
Properly raise a parse error for invalid `for`/`of` statements using `async` as binding name.
Properly recognize \"use strict\" when preceded by a string with an escaped newline.
Mark the `Parser` constructor as protected, not private, so plugins can extend it without type errors.
Fix a bug where some invalid `delete` expressions were let through when the operand was parenthesized and `preserveParens` was enabled.
Properly normalize line endings in raw strings of invalid template tokens.
Properly track line numbers for escaped newlines in strings.
Fix a bug that broke line number accounting after a template literal with invalid escape sequences.
Version 8.11.3 ### Bug fixes Add `Function` and `Class` to the `AggregateType` type, so that they can be used in walkers without raising a type error. Make sure `onToken` get an `import` keyword token when parsing `import.meta`. Fix a bug where `.loc.start` could be undefined for `new.target` `meta` nodes.
PreviousNext