Skip to content

Commit 3104de4

Browse files
authored
Merge branch 'nodejs:main' into #57418
2 parents 4bacb6b + c8b9d38 commit 3104de4

File tree

356 files changed

+5537
-3184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

356 files changed

+5537
-3184
lines changed

.github/workflows/update-openssl.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
author: Node.js GitHub Bot <github-bot@iojs.org>
3636
body: This is an automated update of OpenSSL to ${{ env.NEW_VERSION }}.
3737
branch: actions/tools-update-openssl # Custom branch *just* for this Action.
38-
commit-message: 'deps: upgrade openssl sources to quictls/openssl-${{ env.NEW_VERSION }}'
38+
commit-message: 'deps: upgrade openssl sources to openssl-${{ env.NEW_VERSION }}'
3939
labels: dependencies, openssl
4040
title: 'deps: update OpenSSL to ${{ env.NEW_VERSION }}'
4141
path: deps/openssl

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ release.
3939
</tr>
4040
<tr>
4141
<td valign="top">
42-
<b><a href="doc/changelogs/CHANGELOG_V23.md#23.9.0">23.9.0</a></b><br/>
42+
<b><a href="doc/changelogs/CHANGELOG_V23.md#23.10.0">23.10.0</a></b><br/>
43+
<a href="doc/changelogs/CHANGELOG_V23.md#23.9.0">23.9.0</a><br/>
4344
<a href="doc/changelogs/CHANGELOG_V23.md#23.8.0">23.8.0</a><br/>
4445
<a href="doc/changelogs/CHANGELOG_V23.md#23.7.0">23.7.0</a><br/>
4546
<a href="doc/changelogs/CHANGELOG_V23.md#23.6.1">23.6.1</a><br/>
@@ -72,7 +73,8 @@ release.
7273
<a href="doc/changelogs/CHANGELOG_V22.md#22.0.0">22.0.0</a><br/>
7374
</td>
7475
<td valign="top">
75-
<b><a href="doc/changelogs/CHANGELOG_V20.md#20.18.3">20.18.3</a></b><br/>
76+
<b><a href="doc/changelogs/CHANGELOG_V20.md#20.19.0">20.19.0</a></b><br/>
77+
<a href="doc/changelogs/CHANGELOG_V20.md#20.18.3">20.18.3</a><br/>
7678
<a href="doc/changelogs/CHANGELOG_V20.md#20.18.2">20.18.2</a><br/>
7779
<a href="doc/changelogs/CHANGELOG_V20.md#20.18.1">20.18.1</a><br/>
7880
<a href="doc/changelogs/CHANGELOG_V20.md#20.18.0">20.18.0</a><br/>

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,6 @@ For information about the governance of the Node.js project, see
403403
**Moshe Atlow** <<moshe@atlow.co.il>> (he/him)
404404
* [MrJithil](https://github.com/MrJithil) -
405405
**Jithil P Ponnan** <<jithil@outlook.com>> (he/him)
406-
* [ovflowd](https://github.com/ovflowd) -
407-
**Claudio Wunder** <<cwunder@gnome.org>> (he/they)
408406
* [panva](https://github.com/panva) -
409407
**Filip Skokan** <<panva.ip@gmail.com>> (he/him)
410408
* [pimterry](https://github.com/pimterry) -
@@ -629,6 +627,8 @@ For information about the governance of the Node.js project, see
629627
**Alexis Campailla** <<orangemocha@nodejs.org>>
630628
* [othiym23](https://github.com/othiym23) -
631629
**Forrest L Norvell** <<ogd@aoaioxxysz.net>> (they/them/themself)
630+
* [ovflowd](https://github.com/ovflowd) -
631+
**Claudio Wunder** <<cwunder@gnome.org>> (he/they)
632632
* [oyyd](https://github.com/oyyd) -
633633
**Ouyang Yadong** <<oyydoibh@gmail.com>> (he/him)
634634
* [petkaantonov](https://github.com/petkaantonov) -

deps/acorn/acorn/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## 8.14.1 (2025-03-05)
2+
3+
### Bug fixes
4+
5+
Fix an issue where `await` expressions in class field initializers were inappropriately allowed.
6+
7+
Properly allow await inside an async arrow function inside a class field initializer.
8+
9+
Mention the source file name in syntax error messages when given.
10+
11+
Properly add an empty `attributes` property to every form of `ExportNamedDeclaration`.
12+
113
## 8.14.0 (2024-10-27)
214

315
### New features

deps/acorn/acorn/dist/acorn.js

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@
493493
SCOPE_SUPER = 64,
494494
SCOPE_DIRECT_SUPER = 128,
495495
SCOPE_CLASS_STATIC_BLOCK = 256,
496+
SCOPE_CLASS_FIELD_INIT = 512,
496497
SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;
497498

498499
function functionFlags(async, generator) {
@@ -603,35 +604,38 @@
603604

604605
prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 };
605606

606-
prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit };
607+
prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 };
607608

608-
prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit };
609+
prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 };
609610

610611
prototypeAccessors.canAwait.get = function () {
611612
for (var i = this.scopeStack.length - 1; i >= 0; i--) {
612-
var scope = this.scopeStack[i];
613-
if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) { return false }
614-
if (scope.flags & SCOPE_FUNCTION) { return (scope.flags & SCOPE_ASYNC) > 0 }
613+
var ref = this.scopeStack[i];
614+
var flags = ref.flags;
615+
if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT)) { return false }
616+
if (flags & SCOPE_FUNCTION) { return (flags & SCOPE_ASYNC) > 0 }
615617
}
616618
return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction
617619
};
618620

619621
prototypeAccessors.allowSuper.get = function () {
620622
var ref = this.currentThisScope();
621623
var flags = ref.flags;
622-
var inClassFieldInit = ref.inClassFieldInit;
623-
return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod
624+
return (flags & SCOPE_SUPER) > 0 || this.options.allowSuperOutsideMethod
624625
};
625626

626627
prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 };
627628

628629
prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) };
629630

630631
prototypeAccessors.allowNewDotTarget.get = function () {
631-
var ref = this.currentThisScope();
632-
var flags = ref.flags;
633-
var inClassFieldInit = ref.inClassFieldInit;
634-
return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit
632+
for (var i = this.scopeStack.length - 1; i >= 0; i--) {
633+
var ref = this.scopeStack[i];
634+
var flags = ref.flags;
635+
if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT) ||
636+
((flags & SCOPE_FUNCTION) && !(flags & SCOPE_ARROW))) { return true }
637+
}
638+
return false
635639
};
636640

637641
prototypeAccessors.inClassStaticBlock.get = function () {
@@ -1558,11 +1562,9 @@
15581562

15591563
if (this.eat(types$1.eq)) {
15601564
// To raise SyntaxError if 'arguments' exists in the initializer.
1561-
var scope = this.currentThisScope();
1562-
var inClassFieldInit = scope.inClassFieldInit;
1563-
scope.inClassFieldInit = true;
1565+
this.enterScope(SCOPE_CLASS_FIELD_INIT | SCOPE_SUPER);
15641566
field.value = this.parseMaybeAssign();
1565-
scope.inClassFieldInit = inClassFieldInit;
1567+
this.exitScope();
15661568
} else {
15671569
field.value = null;
15681570
}
@@ -1704,6 +1706,8 @@
17041706
{ this.checkExport(exports, node.declaration.id, node.declaration.id.start); }
17051707
node.specifiers = [];
17061708
node.source = null;
1709+
if (this.options.ecmaVersion >= 16)
1710+
{ node.attributes = []; }
17071711
} else { // export { x, y as z } [from '...']
17081712
node.declaration = null;
17091713
node.specifiers = this.parseExportSpecifiers(exports);
@@ -1727,6 +1731,8 @@
17271731
}
17281732

17291733
node.source = null;
1734+
if (this.options.ecmaVersion >= 16)
1735+
{ node.attributes = []; }
17301736
}
17311737
this.semicolon();
17321738
}
@@ -3306,9 +3312,10 @@
33063312
};
33073313

33083314
pp$5.parseGetterSetter = function(prop) {
3309-
prop.kind = prop.key.name;
3315+
var kind = prop.key.name;
33103316
this.parsePropertyName(prop);
33113317
prop.value = this.parseMethod(false);
3318+
prop.kind = kind;
33123319
var paramCount = prop.kind === "get" ? 0 : 1;
33133320
if (prop.value.params.length !== paramCount) {
33143321
var start = prop.value.start;
@@ -3331,9 +3338,9 @@
33313338
prop.kind = "init";
33323339
} else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) {
33333340
if (isPattern) { this.unexpected(); }
3334-
prop.kind = "init";
33353341
prop.method = true;
33363342
prop.value = this.parseMethod(isGenerator, isAsync);
3343+
prop.kind = "init";
33373344
} else if (!isPattern && !containsEsc &&
33383345
this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" &&
33393346
(prop.key.name === "get" || prop.key.name === "set") &&
@@ -3345,7 +3352,6 @@
33453352
this.checkUnreserved(prop.key);
33463353
if (prop.key.name === "await" && !this.awaitIdentPos)
33473354
{ this.awaitIdentPos = startPos; }
3348-
prop.kind = "init";
33493355
if (isPattern) {
33503356
prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
33513357
} else if (this.type === types$1.eq && refDestructuringErrors) {
@@ -3355,6 +3361,7 @@
33553361
} else {
33563362
prop.value = this.copyNode(prop.key);
33573363
}
3364+
prop.kind = "init";
33583365
prop.shorthand = true;
33593366
} else { this.unexpected(); }
33603367
};
@@ -3530,7 +3537,7 @@
35303537
{ this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); }
35313538
if (this.inAsync && name === "await")
35323539
{ this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); }
3533-
if (this.currentThisScope().inClassFieldInit && name === "arguments")
3540+
if (!(this.currentThisScope().flags & SCOPE_VAR) && name === "arguments")
35343541
{ this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer"); }
35353542
if (this.inClassStaticBlock && (name === "arguments" || name === "await"))
35363543
{ this.raise(start, ("Cannot use " + name + " in class static initialization block")); }
@@ -3643,6 +3650,9 @@
36433650
pp$4.raise = function(pos, message) {
36443651
var loc = getLineInfo(this.input, pos);
36453652
message += " (" + loc.line + ":" + loc.column + ")";
3653+
if (this.sourceFile) {
3654+
message += " in " + this.sourceFile;
3655+
}
36463656
var err = new SyntaxError(message);
36473657
err.pos = pos; err.loc = loc; err.raisedAt = this.pos;
36483658
throw err
@@ -3666,8 +3676,6 @@
36663676
this.lexical = [];
36673677
// A list of lexically-declared FunctionDeclaration names in the current lexical scope
36683678
this.functions = [];
3669-
// A switch to disallow the identifier reference 'arguments'
3670-
this.inClassFieldInit = false;
36713679
};
36723680

36733681
// The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.
@@ -3737,15 +3745,16 @@
37373745
pp$3.currentVarScope = function() {
37383746
for (var i = this.scopeStack.length - 1;; i--) {
37393747
var scope = this.scopeStack[i];
3740-
if (scope.flags & SCOPE_VAR) { return scope }
3748+
if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK)) { return scope }
37413749
}
37423750
};
37433751

37443752
// Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.
37453753
pp$3.currentThisScope = function() {
37463754
for (var i = this.scopeStack.length - 1;; i--) {
37473755
var scope = this.scopeStack[i];
3748-
if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope }
3756+
if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK) &&
3757+
!(scope.flags & SCOPE_ARROW)) { return scope }
37493758
}
37503759
};
37513760

@@ -6099,7 +6108,7 @@
60996108
// [walk]: util/walk.js
61006109

61016110

6102-
var version = "8.14.0";
6111+
var version = "8.14.1";
61036112

61046113
Parser.acorn = {
61056114
Parser: Parser,

0 commit comments

Comments
 (0)