Skip to content

Commit 4f89af8

Browse files
nodejs-github-botmarco-ippolito
authored andcommittedJan 24, 2025
deps: update acorn to 8.14.0
PR-URL: #55699 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>

File tree

7 files changed

+280
-30
lines changed

7 files changed

+280
-30
lines changed
 

Diff for: ‎deps/acorn/acorn/CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## 8.14.0 (2024-10-27)
2+
3+
### New features
4+
5+
Support ES2025 import attributes.
6+
7+
Support ES2025 RegExp modifiers.
8+
9+
### Bug fixes
10+
11+
Support some missing Unicode properties.
12+
113
## 8.13.0 (2024-10-16)
214

315
### New features

Diff for: ‎deps/acorn/acorn/dist/acorn.d.mts

+11-1
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ export interface ImportDeclaration extends Node {
403403
type: "ImportDeclaration"
404404
specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>
405405
source: Literal
406+
attributes: Array<ImportAttribute>
406407
}
407408

408409
export interface ImportSpecifier extends Node {
@@ -421,11 +422,18 @@ export interface ImportNamespaceSpecifier extends Node {
421422
local: Identifier
422423
}
423424

425+
export interface ImportAttribute extends Node {
426+
type: "ImportAttribute"
427+
key: Identifier | Literal
428+
value: Literal
429+
}
430+
424431
export interface ExportNamedDeclaration extends Node {
425432
type: "ExportNamedDeclaration"
426433
declaration?: Declaration | null
427434
specifiers: Array<ExportSpecifier>
428435
source?: Literal | null
436+
attributes: Array<ImportAttribute>
429437
}
430438

431439
export interface ExportSpecifier extends Node {
@@ -454,6 +462,7 @@ export interface ExportAllDeclaration extends Node {
454462
type: "ExportAllDeclaration"
455463
source: Literal
456464
exported?: Identifier | Literal | null
465+
attributes: Array<ImportAttribute>
457466
}
458467

459468
export interface AwaitExpression extends Node {
@@ -469,6 +478,7 @@ export interface ChainExpression extends Node {
469478
export interface ImportExpression extends Node {
470479
type: "ImportExpression"
471480
source: Expression
481+
options: Expression | null
472482
}
473483

474484
export interface ParenthesizedExpression extends Node {
@@ -562,7 +572,7 @@ export type ModuleDeclaration =
562572
| ExportDefaultDeclaration
563573
| ExportAllDeclaration
564574

565-
export type AnyNode = Statement | Expression | Declaration | ModuleDeclaration | Literal | Program | SwitchCase | CatchClause | Property | Super | SpreadElement | TemplateElement | AssignmentProperty | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | ClassBody | MethodDefinition | MetaProperty | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | AnonymousFunctionDeclaration | AnonymousClassDeclaration | PropertyDefinition | PrivateIdentifier | StaticBlock | VariableDeclarator
575+
export type AnyNode = Statement | Expression | Declaration | ModuleDeclaration | Literal | Program | SwitchCase | CatchClause | Property | Super | SpreadElement | TemplateElement | AssignmentProperty | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | ClassBody | MethodDefinition | MetaProperty | ImportAttribute | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | AnonymousFunctionDeclaration | AnonymousClassDeclaration | PropertyDefinition | PrivateIdentifier | StaticBlock | VariableDeclarator
566576

567577
export function parse(input: string, options: Options): Program
568578

Diff for: ‎deps/acorn/acorn/dist/acorn.d.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ export interface ImportDeclaration extends Node {
403403
type: "ImportDeclaration"
404404
specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>
405405
source: Literal
406+
attributes: Array<ImportAttribute>
406407
}
407408

408409
export interface ImportSpecifier extends Node {
@@ -421,11 +422,18 @@ export interface ImportNamespaceSpecifier extends Node {
421422
local: Identifier
422423
}
423424

425+
export interface ImportAttribute extends Node {
426+
type: "ImportAttribute"
427+
key: Identifier | Literal
428+
value: Literal
429+
}
430+
424431
export interface ExportNamedDeclaration extends Node {
425432
type: "ExportNamedDeclaration"
426433
declaration?: Declaration | null
427434
specifiers: Array<ExportSpecifier>
428435
source?: Literal | null
436+
attributes: Array<ImportAttribute>
429437
}
430438

431439
export interface ExportSpecifier extends Node {
@@ -454,6 +462,7 @@ export interface ExportAllDeclaration extends Node {
454462
type: "ExportAllDeclaration"
455463
source: Literal
456464
exported?: Identifier | Literal | null
465+
attributes: Array<ImportAttribute>
457466
}
458467

459468
export interface AwaitExpression extends Node {
@@ -469,6 +478,7 @@ export interface ChainExpression extends Node {
469478
export interface ImportExpression extends Node {
470479
type: "ImportExpression"
471480
source: Expression
481+
options: Expression | null
472482
}
473483

474484
export interface ParenthesizedExpression extends Node {
@@ -562,7 +572,7 @@ export type ModuleDeclaration =
562572
| ExportDefaultDeclaration
563573
| ExportAllDeclaration
564574

565-
export type AnyNode = Statement | Expression | Declaration | ModuleDeclaration | Literal | Program | SwitchCase | CatchClause | Property | Super | SpreadElement | TemplateElement | AssignmentProperty | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | ClassBody | MethodDefinition | MetaProperty | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | AnonymousFunctionDeclaration | AnonymousClassDeclaration | PropertyDefinition | PrivateIdentifier | StaticBlock | VariableDeclarator
575+
export type AnyNode = Statement | Expression | Declaration | ModuleDeclaration | Literal | Program | SwitchCase | CatchClause | Property | Super | SpreadElement | TemplateElement | AssignmentProperty | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | ClassBody | MethodDefinition | MetaProperty | ImportAttribute | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | AnonymousFunctionDeclaration | AnonymousClassDeclaration | PropertyDefinition | PrivateIdentifier | StaticBlock | VariableDeclarator
566576

567577
export function parse(input: string, options: Options): Program
568578

Diff for: ‎deps/acorn/acorn/dist/acorn.js

+122-13
Original file line numberDiff line numberDiff line change
@@ -1678,6 +1678,8 @@
16781678
this.expectContextual("from");
16791679
if (this.type !== types$1.string) { this.unexpected(); }
16801680
node.source = this.parseExprAtom();
1681+
if (this.options.ecmaVersion >= 16)
1682+
{ node.attributes = this.parseWithClause(); }
16811683
this.semicolon();
16821684
return this.finishNode(node, "ExportAllDeclaration")
16831685
};
@@ -1708,6 +1710,8 @@
17081710
if (this.eatContextual("from")) {
17091711
if (this.type !== types$1.string) { this.unexpected(); }
17101712
node.source = this.parseExprAtom();
1713+
if (this.options.ecmaVersion >= 16)
1714+
{ node.attributes = this.parseWithClause(); }
17111715
} else {
17121716
for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
17131717
// check for keywords used as local names
@@ -1848,6 +1852,8 @@
18481852
this.expectContextual("from");
18491853
node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected();
18501854
}
1855+
if (this.options.ecmaVersion >= 16)
1856+
{ node.attributes = this.parseWithClause(); }
18511857
this.semicolon();
18521858
return this.finishNode(node, "ImportDeclaration")
18531859
};
@@ -1908,6 +1914,41 @@
19081914
return nodes
19091915
};
19101916

1917+
pp$8.parseWithClause = function() {
1918+
var nodes = [];
1919+
if (!this.eat(types$1._with)) {
1920+
return nodes
1921+
}
1922+
this.expect(types$1.braceL);
1923+
var attributeKeys = {};
1924+
var first = true;
1925+
while (!this.eat(types$1.braceR)) {
1926+
if (!first) {
1927+
this.expect(types$1.comma);
1928+
if (this.afterTrailingComma(types$1.braceR)) { break }
1929+
} else { first = false; }
1930+
1931+
var attr = this.parseImportAttribute();
1932+
var keyName = attr.key.type === "Identifier" ? attr.key.name : attr.key.value;
1933+
if (hasOwn(attributeKeys, keyName))
1934+
{ this.raiseRecoverable(attr.key.start, "Duplicate attribute key '" + keyName + "'"); }
1935+
attributeKeys[keyName] = true;
1936+
nodes.push(attr);
1937+
}
1938+
return nodes
1939+
};
1940+
1941+
pp$8.parseImportAttribute = function() {
1942+
var node = this.startNode();
1943+
node.key = this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
1944+
this.expect(types$1.colon);
1945+
if (this.type !== types$1.string) {
1946+
this.unexpected();
1947+
}
1948+
node.value = this.parseExprAtom();
1949+
return this.finishNode(node, "ImportAttribute")
1950+
};
1951+
19111952
pp$8.parseModuleExportName = function() {
19121953
if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {
19131954
var stringLiteral = this.parseLiteral(this.value);
@@ -2975,13 +3016,32 @@
29753016
// Parse node.source.
29763017
node.source = this.parseMaybeAssign();
29773018

2978-
// Verify ending.
2979-
if (!this.eat(types$1.parenR)) {
2980-
var errorPos = this.start;
2981-
if (this.eat(types$1.comma) && this.eat(types$1.parenR)) {
2982-
this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()");
3019+
if (this.options.ecmaVersion >= 16) {
3020+
if (!this.eat(types$1.parenR)) {
3021+
this.expect(types$1.comma);
3022+
if (!this.afterTrailingComma(types$1.parenR)) {
3023+
node.options = this.parseMaybeAssign();
3024+
if (!this.eat(types$1.parenR)) {
3025+
this.expect(types$1.comma);
3026+
if (!this.afterTrailingComma(types$1.parenR)) {
3027+
this.unexpected();
3028+
}
3029+
}
3030+
} else {
3031+
node.options = null;
3032+
}
29833033
} else {
2984-
this.unexpected(errorPos);
3034+
node.options = null;
3035+
}
3036+
} else {
3037+
// Verify ending.
3038+
if (!this.eat(types$1.parenR)) {
3039+
var errorPos = this.start;
3040+
if (this.eat(types$1.comma) && this.eat(types$1.parenR)) {
3041+
this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()");
3042+
} else {
3043+
this.unexpected(errorPos);
3044+
}
29853045
}
29863046
}
29873047

@@ -3741,6 +3801,9 @@
37413801
return newNode
37423802
};
37433803

3804+
// This file was generated by "bin/generate-unicode-script-values.js". Do not modify manually!
3805+
var scriptValuesAddedInUnicode = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz";
3806+
37443807
// This file contains Unicode properties extracted from the ECMAScript specification.
37453808
// The lists are extracted like so:
37463809
// $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)
@@ -3783,7 +3846,7 @@
37833846
var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
37843847
var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
37853848
var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith";
3786-
var ecma14ScriptValues = ecma13ScriptValues + " Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz";
3849+
var ecma14ScriptValues = ecma13ScriptValues + " " + scriptValuesAddedInUnicode;
37873850

37883851
var unicodeScriptValues = {
37893852
9: ecma9ScriptValues,
@@ -4208,12 +4271,41 @@
42084271
pp$1.regexp_eatUncapturingGroup = function(state) {
42094272
var start = state.pos;
42104273
if (state.eat(0x28 /* ( */)) {
4211-
if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) {
4212-
this.regexp_disjunction(state);
4213-
if (state.eat(0x29 /* ) */)) {
4214-
return true
4274+
if (state.eat(0x3F /* ? */)) {
4275+
if (this.options.ecmaVersion >= 16) {
4276+
var addModifiers = this.regexp_eatModifiers(state);
4277+
var hasHyphen = state.eat(0x2D /* - */);
4278+
if (addModifiers || hasHyphen) {
4279+
for (var i = 0; i < addModifiers.length; i++) {
4280+
var modifier = addModifiers.charAt(i);
4281+
if (addModifiers.indexOf(modifier, i + 1) > -1) {
4282+
state.raise("Duplicate regular expression modifiers");
4283+
}
4284+
}
4285+
if (hasHyphen) {
4286+
var removeModifiers = this.regexp_eatModifiers(state);
4287+
if (!addModifiers && !removeModifiers && state.current() === 0x3A /* : */) {
4288+
state.raise("Invalid regular expression modifiers");
4289+
}
4290+
for (var i$1 = 0; i$1 < removeModifiers.length; i$1++) {
4291+
var modifier$1 = removeModifiers.charAt(i$1);
4292+
if (
4293+
removeModifiers.indexOf(modifier$1, i$1 + 1) > -1 ||
4294+
addModifiers.indexOf(modifier$1) > -1
4295+
) {
4296+
state.raise("Duplicate regular expression modifiers");
4297+
}
4298+
}
4299+
}
4300+
}
4301+
}
4302+
if (state.eat(0x3A /* : */)) {
4303+
this.regexp_disjunction(state);
4304+
if (state.eat(0x29 /* ) */)) {
4305+
return true
4306+
}
4307+
state.raise("Unterminated group");
42154308
}
4216-
state.raise("Unterminated group");
42174309
}
42184310
state.pos = start;
42194311
}
@@ -4235,6 +4327,23 @@
42354327
}
42364328
return false
42374329
};
4330+
// RegularExpressionModifiers ::
4331+
// [empty]
4332+
// RegularExpressionModifiers RegularExpressionModifier
4333+
pp$1.regexp_eatModifiers = function(state) {
4334+
var modifiers = "";
4335+
var ch = 0;
4336+
while ((ch = state.current()) !== -1 && isRegularExpressionModifier(ch)) {
4337+
modifiers += codePointToString(ch);
4338+
state.advance();
4339+
}
4340+
return modifiers
4341+
};
4342+
// RegularExpressionModifier :: one of
4343+
// `i` `m` `s`
4344+
function isRegularExpressionModifier(ch) {
4345+
return ch === 0x69 /* i */ || ch === 0x6d /* m */ || ch === 0x73 /* s */
4346+
}
42384347

42394348
// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom
42404349
pp$1.regexp_eatExtendedAtom = function(state) {
@@ -5990,7 +6099,7 @@
59906099
// [walk]: util/walk.js
59916100

59926101

5993-
var version = "8.13.0";
6102+
var version = "8.14.0";
59946103

59956104
Parser.acorn = {
59966105
Parser: Parser,

Diff for: ‎deps/acorn/acorn/dist/acorn.mjs

+122-13
Original file line numberDiff line numberDiff line change
@@ -1672,6 +1672,8 @@ pp$8.parseExportAllDeclaration = function(node, exports) {
16721672
this.expectContextual("from");
16731673
if (this.type !== types$1.string) { this.unexpected(); }
16741674
node.source = this.parseExprAtom();
1675+
if (this.options.ecmaVersion >= 16)
1676+
{ node.attributes = this.parseWithClause(); }
16751677
this.semicolon();
16761678
return this.finishNode(node, "ExportAllDeclaration")
16771679
};
@@ -1702,6 +1704,8 @@ pp$8.parseExport = function(node, exports) {
17021704
if (this.eatContextual("from")) {
17031705
if (this.type !== types$1.string) { this.unexpected(); }
17041706
node.source = this.parseExprAtom();
1707+
if (this.options.ecmaVersion >= 16)
1708+
{ node.attributes = this.parseWithClause(); }
17051709
} else {
17061710
for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
17071711
// check for keywords used as local names
@@ -1842,6 +1846,8 @@ pp$8.parseImport = function(node) {
18421846
this.expectContextual("from");
18431847
node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected();
18441848
}
1849+
if (this.options.ecmaVersion >= 16)
1850+
{ node.attributes = this.parseWithClause(); }
18451851
this.semicolon();
18461852
return this.finishNode(node, "ImportDeclaration")
18471853
};
@@ -1902,6 +1908,41 @@ pp$8.parseImportSpecifiers = function() {
19021908
return nodes
19031909
};
19041910

1911+
pp$8.parseWithClause = function() {
1912+
var nodes = [];
1913+
if (!this.eat(types$1._with)) {
1914+
return nodes
1915+
}
1916+
this.expect(types$1.braceL);
1917+
var attributeKeys = {};
1918+
var first = true;
1919+
while (!this.eat(types$1.braceR)) {
1920+
if (!first) {
1921+
this.expect(types$1.comma);
1922+
if (this.afterTrailingComma(types$1.braceR)) { break }
1923+
} else { first = false; }
1924+
1925+
var attr = this.parseImportAttribute();
1926+
var keyName = attr.key.type === "Identifier" ? attr.key.name : attr.key.value;
1927+
if (hasOwn(attributeKeys, keyName))
1928+
{ this.raiseRecoverable(attr.key.start, "Duplicate attribute key '" + keyName + "'"); }
1929+
attributeKeys[keyName] = true;
1930+
nodes.push(attr);
1931+
}
1932+
return nodes
1933+
};
1934+
1935+
pp$8.parseImportAttribute = function() {
1936+
var node = this.startNode();
1937+
node.key = this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
1938+
this.expect(types$1.colon);
1939+
if (this.type !== types$1.string) {
1940+
this.unexpected();
1941+
}
1942+
node.value = this.parseExprAtom();
1943+
return this.finishNode(node, "ImportAttribute")
1944+
};
1945+
19051946
pp$8.parseModuleExportName = function() {
19061947
if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {
19071948
var stringLiteral = this.parseLiteral(this.value);
@@ -2969,13 +3010,32 @@ pp$5.parseDynamicImport = function(node) {
29693010
// Parse node.source.
29703011
node.source = this.parseMaybeAssign();
29713012

2972-
// Verify ending.
2973-
if (!this.eat(types$1.parenR)) {
2974-
var errorPos = this.start;
2975-
if (this.eat(types$1.comma) && this.eat(types$1.parenR)) {
2976-
this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()");
3013+
if (this.options.ecmaVersion >= 16) {
3014+
if (!this.eat(types$1.parenR)) {
3015+
this.expect(types$1.comma);
3016+
if (!this.afterTrailingComma(types$1.parenR)) {
3017+
node.options = this.parseMaybeAssign();
3018+
if (!this.eat(types$1.parenR)) {
3019+
this.expect(types$1.comma);
3020+
if (!this.afterTrailingComma(types$1.parenR)) {
3021+
this.unexpected();
3022+
}
3023+
}
3024+
} else {
3025+
node.options = null;
3026+
}
29773027
} else {
2978-
this.unexpected(errorPos);
3028+
node.options = null;
3029+
}
3030+
} else {
3031+
// Verify ending.
3032+
if (!this.eat(types$1.parenR)) {
3033+
var errorPos = this.start;
3034+
if (this.eat(types$1.comma) && this.eat(types$1.parenR)) {
3035+
this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()");
3036+
} else {
3037+
this.unexpected(errorPos);
3038+
}
29793039
}
29803040
}
29813041

@@ -3735,6 +3795,9 @@ pp$2.copyNode = function(node) {
37353795
return newNode
37363796
};
37373797

3798+
// This file was generated by "bin/generate-unicode-script-values.js". Do not modify manually!
3799+
var scriptValuesAddedInUnicode = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz";
3800+
37383801
// This file contains Unicode properties extracted from the ECMAScript specification.
37393802
// The lists are extracted like so:
37403803
// $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)
@@ -3777,7 +3840,7 @@ var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Han
37773840
var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
37783841
var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
37793842
var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith";
3780-
var ecma14ScriptValues = ecma13ScriptValues + " Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz";
3843+
var ecma14ScriptValues = ecma13ScriptValues + " " + scriptValuesAddedInUnicode;
37813844

37823845
var unicodeScriptValues = {
37833846
9: ecma9ScriptValues,
@@ -4202,12 +4265,41 @@ pp$1.regexp_eatReverseSolidusAtomEscape = function(state) {
42024265
pp$1.regexp_eatUncapturingGroup = function(state) {
42034266
var start = state.pos;
42044267
if (state.eat(0x28 /* ( */)) {
4205-
if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) {
4206-
this.regexp_disjunction(state);
4207-
if (state.eat(0x29 /* ) */)) {
4208-
return true
4268+
if (state.eat(0x3F /* ? */)) {
4269+
if (this.options.ecmaVersion >= 16) {
4270+
var addModifiers = this.regexp_eatModifiers(state);
4271+
var hasHyphen = state.eat(0x2D /* - */);
4272+
if (addModifiers || hasHyphen) {
4273+
for (var i = 0; i < addModifiers.length; i++) {
4274+
var modifier = addModifiers.charAt(i);
4275+
if (addModifiers.indexOf(modifier, i + 1) > -1) {
4276+
state.raise("Duplicate regular expression modifiers");
4277+
}
4278+
}
4279+
if (hasHyphen) {
4280+
var removeModifiers = this.regexp_eatModifiers(state);
4281+
if (!addModifiers && !removeModifiers && state.current() === 0x3A /* : */) {
4282+
state.raise("Invalid regular expression modifiers");
4283+
}
4284+
for (var i$1 = 0; i$1 < removeModifiers.length; i$1++) {
4285+
var modifier$1 = removeModifiers.charAt(i$1);
4286+
if (
4287+
removeModifiers.indexOf(modifier$1, i$1 + 1) > -1 ||
4288+
addModifiers.indexOf(modifier$1) > -1
4289+
) {
4290+
state.raise("Duplicate regular expression modifiers");
4291+
}
4292+
}
4293+
}
4294+
}
4295+
}
4296+
if (state.eat(0x3A /* : */)) {
4297+
this.regexp_disjunction(state);
4298+
if (state.eat(0x29 /* ) */)) {
4299+
return true
4300+
}
4301+
state.raise("Unterminated group");
42094302
}
4210-
state.raise("Unterminated group");
42114303
}
42124304
state.pos = start;
42134305
}
@@ -4229,6 +4321,23 @@ pp$1.regexp_eatCapturingGroup = function(state) {
42294321
}
42304322
return false
42314323
};
4324+
// RegularExpressionModifiers ::
4325+
// [empty]
4326+
// RegularExpressionModifiers RegularExpressionModifier
4327+
pp$1.regexp_eatModifiers = function(state) {
4328+
var modifiers = "";
4329+
var ch = 0;
4330+
while ((ch = state.current()) !== -1 && isRegularExpressionModifier(ch)) {
4331+
modifiers += codePointToString(ch);
4332+
state.advance();
4333+
}
4334+
return modifiers
4335+
};
4336+
// RegularExpressionModifier :: one of
4337+
// `i` `m` `s`
4338+
function isRegularExpressionModifier(ch) {
4339+
return ch === 0x69 /* i */ || ch === 0x6d /* m */ || ch === 0x73 /* s */
4340+
}
42324341

42334342
// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom
42344343
pp$1.regexp_eatExtendedAtom = function(state) {
@@ -5984,7 +6093,7 @@ pp.readWord = function() {
59846093
// [walk]: util/walk.js
59856094

59866095

5987-
var version = "8.13.0";
6096+
var version = "8.14.0";
59886097

59896098
Parser.acorn = {
59906099
Parser: Parser,

Diff for: ‎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.13.0",
19+
"version": "8.14.0",
2020
"engines": {
2121
"node": ">=0.4.0"
2222
},

Diff for: ‎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.13.0"
5+
#define ACORN_VERSION "8.14.0"
66
#endif // SRC_ACORN_VERSION_H_

0 commit comments

Comments
 (0)
Please sign in to comment.