Skip to content
Merged
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
6 changes: 6 additions & 0 deletions deps/acorn/acorn/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 8.10.0 (2023-07-05)

### New features

Add a `checkPrivateFields` option that disables strict checking of private property use.

## 8.9.0 (2023-06-16)

### Bug fixes
Expand Down
4 changes: 4 additions & 0 deletions deps/acorn/acorn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ required):
characters `#!` (as in a shellscript), the first line will be
treated as a comment. Defaults to true when `ecmaVersion` >= 2023.

- **checkPrivateFields**: By default, the parser will verify that
private properties are only used in places where they are valid and
have been declared. Set this to false to turn such checks off.

- **locations**: When `true`, each node has a `loc` object attached
with `start` and `end` subobjects, each of which contains the
one-based line and zero-based column numbers in `{line, column}`
Expand Down
2 changes: 1 addition & 1 deletion deps/acorn/acorn/dist/acorn.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ declare namespace acorn {
[Symbol.iterator](): Iterator<Token>
}

type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 'latest'
type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 'latest'

interface Options {
ecmaVersion: ecmaVersion
Expand Down
19 changes: 13 additions & 6 deletions deps/acorn/acorn/dist/acorn.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@
// allowed and treated as a line comment. Enabled by default when
// `ecmaVersion` >= 2023.
allowHashBang: false,
// By default, the parser will verify that private properties are
// only used in places where they are valid and have been declared.
// Set this to false to turn such checks off.
checkPrivateFields: true,
// When `locations` is on, `loc` properties holding objects with
// `start` and `end` properties in `{line, column}` form (with
// line being 1-based and column 0-based) will be attached to the
Expand Down Expand Up @@ -1600,6 +1604,7 @@
var ref = this.privateNameStack.pop();
var declared = ref.declared;
var used = ref.used;
if (!this.options.checkPrivateFields) { return }
var len = this.privateNameStack.length;
var parent = len === 0 ? null : this.privateNameStack[len - 1];
for (var i = 0; i < used.length; ++i) {
Expand Down Expand Up @@ -2661,7 +2666,7 @@
else { sawUnary = true; }
expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
} else if (!sawUnary && this.type === types$1.privateId) {
if (forInit || this.privateNameStack.length === 0) { this.unexpected(); }
if ((forInit || this.privateNameStack.length === 0) && this.options.checkPrivateFields) { this.unexpected(); }
expr = this.parsePrivateIdent();
// only could be private fields in 'in', such as #x in obj
if (this.type !== types$1._in) { this.unexpected(); }
Expand Down Expand Up @@ -3504,10 +3509,12 @@
this.finishNode(node, "PrivateIdentifier");

// For validating existence
if (this.privateNameStack.length === 0) {
this.raise(node.start, ("Private field '#" + (node.name) + "' must be declared in an enclosing class"));
} else {
this.privateNameStack[this.privateNameStack.length - 1].used.push(node);
if (this.options.checkPrivateFields) {
if (this.privateNameStack.length === 0) {
this.raise(node.start, ("Private field '#" + (node.name) + "' must be declared in an enclosing class"));
} else {
this.privateNameStack[this.privateNameStack.length - 1].used.push(node);
}
}

return node
Expand Down Expand Up @@ -5907,7 +5914,7 @@
// [walk]: util/walk.js


var version = "8.9.0";
var version = "8.10.0";

Parser.acorn = {
Parser: Parser,
Expand Down
19 changes: 13 additions & 6 deletions deps/acorn/acorn/dist/acorn.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,10 @@ var defaultOptions = {
// allowed and treated as a line comment. Enabled by default when
// `ecmaVersion` >= 2023.
allowHashBang: false,
// By default, the parser will verify that private properties are
// only used in places where they are valid and have been declared.
// Set this to false to turn such checks off.
checkPrivateFields: true,
// When `locations` is on, `loc` properties holding objects with
// `start` and `end` properties in `{line, column}` form (with
// line being 1-based and column 0-based) will be attached to the
Expand Down Expand Up @@ -1594,6 +1598,7 @@ pp$8.exitClassBody = function() {
var ref = this.privateNameStack.pop();
var declared = ref.declared;
var used = ref.used;
if (!this.options.checkPrivateFields) { return }
var len = this.privateNameStack.length;
var parent = len === 0 ? null : this.privateNameStack[len - 1];
for (var i = 0; i < used.length; ++i) {
Expand Down Expand Up @@ -2655,7 +2660,7 @@ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni
else { sawUnary = true; }
expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
} else if (!sawUnary && this.type === types$1.privateId) {
if (forInit || this.privateNameStack.length === 0) { this.unexpected(); }
if ((forInit || this.privateNameStack.length === 0) && this.options.checkPrivateFields) { this.unexpected(); }
expr = this.parsePrivateIdent();
// only could be private fields in 'in', such as #x in obj
if (this.type !== types$1._in) { this.unexpected(); }
Expand Down Expand Up @@ -3498,10 +3503,12 @@ pp$5.parsePrivateIdent = function() {
this.finishNode(node, "PrivateIdentifier");

// For validating existence
if (this.privateNameStack.length === 0) {
this.raise(node.start, ("Private field '#" + (node.name) + "' must be declared in an enclosing class"));
} else {
this.privateNameStack[this.privateNameStack.length - 1].used.push(node);
if (this.options.checkPrivateFields) {
if (this.privateNameStack.length === 0) {
this.raise(node.start, ("Private field '#" + (node.name) + "' must be declared in an enclosing class"));
} else {
this.privateNameStack[this.privateNameStack.length - 1].used.push(node);
}
}

return node
Expand Down Expand Up @@ -5901,7 +5908,7 @@ pp.readWord = function() {
// [walk]: util/walk.js


var version = "8.9.0";
var version = "8.10.0";

Parser.acorn = {
Parser: Parser,
Expand Down
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.9.0",
"version": "8.10.0",
"engines": {
"node": ">=0.4.0"
},
Expand Down
6 changes: 3 additions & 3 deletions doc/contributing/maintaining/maintaining-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ directories to create the Node.js binaries.
All dependencies are located within the `deps` directory.
This a list of all the dependencies:

* [acorn 8.9.0][]
* [acorn 8.10.0][]
* [ada 2.5.0][]
* [base64 0.5.0][]
* [brotli 1.0.9][]
Expand Down Expand Up @@ -144,7 +144,7 @@ takes care of npm update, it is maintained by the npm team.

## Dependency list

### acorn 8.9.0
### acorn 8.10.0

The [acorn](https://github.com/acornjs/acorn) dependency is a JavaScript parser.
[acorn-walk](https://github.com/acornjs/acorn/tree/master/acorn-walk) is
Expand Down Expand Up @@ -318,7 +318,7 @@ dependency lossless data-compression library,
it comes from the Chromium team's zlib fork which incorporated
performance improvements not currently available in standard zlib.

[acorn 8.9.0]: #acorn-890
[acorn 8.10.0]: #acorn-8100
[ada 2.5.0]: #ada-250
[base64 0.5.0]: #base64-050
[brotli 1.0.9]: #brotli-109
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/update-acorn.sh
#ifndef SRC_ACORN_VERSION_H_
#define SRC_ACORN_VERSION_H_
#define ACORN_VERSION "8.9.0"
#define ACORN_VERSION "8.10.0"
#endif // SRC_ACORN_VERSION_H_