Skip to content

Commit 24a9a72

Browse files
nodejs-github-botRafaelGSS
authored andcommitted
deps: update acorn to 8.11.3
PR-URL: #51317 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 2eb41f8 commit 24a9a72

File tree

5 files changed

+30
-18
lines changed

5 files changed

+30
-18
lines changed

deps/acorn/acorn/CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 8.11.3 (2023-12-29)
2+
3+
### Bug fixes
4+
5+
Add `Function` and `Class` to the `AggregateType` type, so that they can be used in walkers without raising a type error.
6+
7+
Make sure `onToken` get an `import` keyword token when parsing `import.meta`.
8+
9+
Fix a bug where `.loc.start` could be undefined for `new.target` `meta` nodes.
10+
111
## 8.11.2 (2023-10-27)
212

313
### Bug fixes

deps/acorn/acorn/dist/acorn.js

+9-8
Original file line numberDiff line numberDiff line change
@@ -2942,12 +2942,14 @@
29422942
// Consume `import` as an identifier for `import.meta`.
29432943
// Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.
29442944
if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); }
2945-
var meta = this.parseIdent(true);
2945+
this.next();
29462946

29472947
if (this.type === types$1.parenL && !forNew) {
29482948
return this.parseDynamicImport(node)
29492949
} else if (this.type === types$1.dot) {
2950-
node.meta = meta;
2950+
var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
2951+
meta.name = "import";
2952+
node.meta = this.finishNode(meta, "Identifier");
29512953
return this.parseImportMeta(node)
29522954
} else {
29532955
this.unexpected();
@@ -3097,7 +3099,7 @@
30973099
var node = this.startNode();
30983100
this.next();
30993101
if (this.options.ecmaVersion >= 6 && this.type === types$1.dot) {
3100-
var meta = this.startNodeAt(node.start, node.startLoc);
3102+
var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
31013103
meta.name = "new";
31023104
node.meta = this.finishNode(meta, "Identifier");
31033105
this.next();
@@ -5925,7 +5927,7 @@
59255927
// [walk]: util/walk.js
59265928

59275929

5928-
var version = "8.11.2";
5930+
var version = "8.11.3";
59295931

59305932
Parser.acorn = {
59315933
Parser: Parser,
@@ -5950,11 +5952,10 @@
59505952
};
59515953

59525954
// The main exported interface (under `self.acorn` when in the
5953-
// browser) is a `parse` function that takes a code string and
5954-
// returns an abstract syntax tree as specified by [Mozilla parser
5955-
// API][api].
5955+
// browser) is a `parse` function that takes a code string and returns
5956+
// an abstract syntax tree as specified by the [ESTree spec][estree].
59565957
//
5957-
// [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API
5958+
// [estree]: https://github.com/estree/estree
59585959

59595960
function parse(input, options) {
59605961
return Parser.parse(input, options)

deps/acorn/acorn/dist/acorn.mjs

+9-8
Original file line numberDiff line numberDiff line change
@@ -2936,12 +2936,14 @@ pp$5.parseExprImport = function(forNew) {
29362936
// Consume `import` as an identifier for `import.meta`.
29372937
// Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.
29382938
if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); }
2939-
var meta = this.parseIdent(true);
2939+
this.next();
29402940

29412941
if (this.type === types$1.parenL && !forNew) {
29422942
return this.parseDynamicImport(node)
29432943
} else if (this.type === types$1.dot) {
2944-
node.meta = meta;
2944+
var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
2945+
meta.name = "import";
2946+
node.meta = this.finishNode(meta, "Identifier");
29452947
return this.parseImportMeta(node)
29462948
} else {
29472949
this.unexpected();
@@ -3091,7 +3093,7 @@ pp$5.parseNew = function() {
30913093
var node = this.startNode();
30923094
this.next();
30933095
if (this.options.ecmaVersion >= 6 && this.type === types$1.dot) {
3094-
var meta = this.startNodeAt(node.start, node.startLoc);
3096+
var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
30953097
meta.name = "new";
30963098
node.meta = this.finishNode(meta, "Identifier");
30973099
this.next();
@@ -5919,7 +5921,7 @@ pp.readWord = function() {
59195921
// [walk]: util/walk.js
59205922

59215923

5922-
var version = "8.11.2";
5924+
var version = "8.11.3";
59235925

59245926
Parser.acorn = {
59255927
Parser: Parser,
@@ -5944,11 +5946,10 @@ Parser.acorn = {
59445946
};
59455947

59465948
// The main exported interface (under `self.acorn` when in the
5947-
// browser) is a `parse` function that takes a code string and
5948-
// returns an abstract syntax tree as specified by [Mozilla parser
5949-
// API][api].
5949+
// browser) is a `parse` function that takes a code string and returns
5950+
// an abstract syntax tree as specified by the [ESTree spec][estree].
59505951
//
5951-
// [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API
5952+
// [estree]: https://github.com/estree/estree
59525953

59535954
function parse(input, options) {
59545955
return Parser.parse(input, options)

deps/acorn/acorn/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
],
1717
"./package.json": "./package.json"
1818
},
19-
"version": "8.11.2",
19+
"version": "8.11.3",
2020
"engines": {
2121
"node": ">=0.4.0"
2222
},

src/acorn_version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
// Refer to tools/dep_updaters/update-acorn.sh
33
#ifndef SRC_ACORN_VERSION_H_
44
#define SRC_ACORN_VERSION_H_
5-
#define ACORN_VERSION "8.11.2"
5+
#define ACORN_VERSION "8.11.3"
66
#endif // SRC_ACORN_VERSION_H_

0 commit comments

Comments
 (0)