Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions deps/acorn/acorn/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## 8.16.0 (2026-02-19)

### 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 (2025-06-08)

### New features
Expand Down
39 changes: 29 additions & 10 deletions deps/acorn/acorn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@ git clone https://github.com/acornjs/acorn.git
cd acorn
npm install
```
## Importing acorn

ESM as well as CommonJS is supported for all 3: `acorn`, `acorn-walk` and `acorn-loose`.

ESM example for `acorn`:

```js
import * as acorn from "acorn"
```

CommonJS example for `acorn`:

```js
let acorn = require("acorn")
```

ESM is preferred, as it allows better editor auto-completions by offering TypeScript support.
For this reason, following examples will use ESM imports.

## Interface

Expand All @@ -36,8 +54,8 @@ syntax tree object as specified by the [ESTree
spec](https://github.com/estree/estree).

```javascript
let acorn = require("acorn");
console.log(acorn.parse("1 + 1", {ecmaVersion: 2020}));
import * as acorn from "acorn"
console.log(acorn.parse("1 + 1", {ecmaVersion: 2020}))
```

When encountering a syntax error, the parser will raise a
Expand All @@ -61,11 +79,12 @@ required):
implemented through plugins.

- **sourceType**: Indicate the mode the code should be parsed in. Can be
either `"script"` or `"module"`. This influences global strict mode
either `"script"`, `"module"` or `"commonjs"`. This influences global strict mode
and parsing of `import` and `export` declarations.

**NOTE**: If set to `"module"`, then static `import` / `export` syntax
will be valid, even if `ecmaVersion` is less than 6.
will be valid, even if `ecmaVersion` is less than 6. If set to `"commonjs"`,
it is the same as `"script"` except that the top-level scope behaves like a function.

- **onInsertedSemicolon**: If given a callback, that callback will be
called whenever a missing semicolon is inserted by the parser. The
Expand Down Expand Up @@ -97,7 +116,7 @@ required):
for `ecmaVersion` 2022 and later, `false` for lower versions.
Setting this option to `true` allows to have top-level `await`
expressions. They are still not allowed in non-`async` functions,
though.
though. Setting this option to `true` is not allowed when `sourceType: "commonjs"`.

- **allowSuperOutsideMethod**: By default, `super` outside a method
raises an error. Set this to `true` to accept such code.
Expand Down Expand Up @@ -217,7 +236,7 @@ for (let token of acorn.tokenizer(str)) {
}

// transform code to array of tokens:
var tokens = [...acorn.tokenizer(str)];
var tokens = [...acorn.tokenizer(str)]
```

**tokTypes** holds an object mapping names to the token type objects
Expand All @@ -238,10 +257,10 @@ on the extended version of the class. To extend a parser with plugins,
you can use its static `extend` method.

```javascript
var acorn = require("acorn");
var jsx = require("acorn-jsx");
var JSXParser = acorn.Parser.extend(jsx());
JSXParser.parse("foo(<bar/>)", {ecmaVersion: 2020});
var acorn = require("acorn")
var jsx = require("acorn-jsx")
var JSXParser = acorn.Parser.extend(jsx())
JSXParser.parse("foo(<bar/>)", {ecmaVersion: 2020})
```

The `extend` method takes any number of plugin values, and returns a
Expand Down
4 changes: 2 additions & 2 deletions deps/acorn/acorn/dist/acorn.d.mts
Original file line number Diff line number Diff line change
Expand Up @@ -614,10 +614,10 @@ export interface Options {

/**
* `sourceType` indicates the mode the code should be parsed in.
* Can be either `"script"` or `"module"`. This influences global
* Can be either `"script"`, `"module"` or `"commonjs"`. This influences global
* strict mode and parsing of `import` and `export` declarations.
*/
sourceType?: "script" | "module"
sourceType?: "script" | "module" | "commonjs"

/**
* a callback that will be called when a semicolon is automatically inserted.
Expand Down
4 changes: 2 additions & 2 deletions deps/acorn/acorn/dist/acorn.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -614,10 +614,10 @@ export interface Options {

/**
* `sourceType` indicates the mode the code should be parsed in.
* Can be either `"script"` or `"module"`. This influences global
* Can be either `"script"`, `"module"` or `"commonjs"`. This influences global
* strict mode and parsing of `import` and `export` declarations.
*/
sourceType?: "script" | "module"
sourceType?: "script" | "module" | "commonjs"

/**
* a callback that will be called when a semicolon is automatically inserted.
Expand Down
123 changes: 78 additions & 45 deletions deps/acorn/acorn/dist/acorn.js

Large diffs are not rendered by default.

123 changes: 78 additions & 45 deletions deps/acorn/acorn/dist/acorn.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deps/acorn/acorn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
],
"./package.json": "./package.json"
},
"version": "8.15.0",
"version": "8.16.0",
"engines": {
"node": ">=0.4.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/acorn_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
// Refer to tools/dep_updaters/update-acorn.sh
#ifndef SRC_ACORN_VERSION_H_
#define SRC_ACORN_VERSION_H_
#define ACORN_VERSION "8.15.0"
#define ACORN_VERSION "8.16.0"
#endif // SRC_ACORN_VERSION_H_
Loading