Skip to content

Tags: acornjs/acorn

Tags

8.17.0

Toggle 8.17.0's commit message
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.

8.16.0

Toggle 8.16.0's commit message
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.

8.15.0

Toggle 8.15.0's commit message
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.

8.14.1

Toggle 8.14.1's commit message
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`.

8.14.0

Toggle 8.14.0's commit message
Version 8.14.0

### New features

Support ES2025 import attributes.

Support ES2025 RegExp modifiers.

### Bug fixes

Support some missing Unicode properties.

8.13.0

Toggle 8.13.0's commit message
Version 8.13.0

### New features

Upgrade to Unicode 16.0.

8.12.1

Toggle 8.12.1's commit message
Version 8.12.1

### Bug fixes

Fix a regression that caused Acorn to no longer run on Node versions <8.10.

8.12.0

Toggle 8.12.0's commit message
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.

8.11.3

Toggle 8.11.3's commit message
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.

8.11.2

Toggle 8.11.2's commit message
Version 8.11.2

### Bug fixes

Fix a bug that caused regular expressions after colon tokens to not be properly tokenized in some circumstances.