Skip to content

Commit c103057

Browse files
committed
[GR-52466] Backport to 24.0: Upgrading the underlying Node.js to version 18.19.1.
PullRequest: js/3084
2 parents f2e7ec7 + 2798cd3 commit c103057

File tree

4,139 files changed

+136137
-87872
lines changed

Some content is hidden

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

4,139 files changed

+136137
-87872
lines changed

3rd_party_licenses.txt

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
512512

513513
================================================================================
514514

515-
Node.js 18.18.2
515+
Node.js 18.19.1
516516

517517
Node.js is licensed for use as follows:
518518

@@ -594,19 +594,30 @@ The externally maintained libraries used by Node.js are:
594594

595595
- c-ares, located at deps/cares, is licensed as follows:
596596
"""
597-
Copyright (c) 2007 - 2018, Daniel Stenberg with many contributors, see AUTHORS
597+
MIT License
598+
599+
Copyright (c) 1998 Massachusetts Institute of Technology
600+
Copyright (c) 2007 - 2023 Daniel Stenberg with many contributors, see AUTHORS
598601
file.
599602

600-
Copyright 1998 by the Massachusetts Institute of Technology.
603+
Permission is hereby granted, free of charge, to any person obtaining a copy of
604+
this software and associated documentation files (the "Software"), to deal in
605+
the Software without restriction, including without limitation the rights to
606+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
607+
the Software, and to permit persons to whom the Software is furnished to do so,
608+
subject to the following conditions:
609+
610+
The above copyright notice and this permission notice (including the next
611+
paragraph) shall be included in all copies or substantial portions of the
612+
Software.
601613

602-
Permission to use, copy, modify, and distribute this software and its
603-
documentation for any purpose and without fee is hereby granted, provided that
604-
the above copyright notice appear in all copies and that both that copyright
605-
notice and this permission notice appear in supporting documentation, and that
606-
the name of M.I.T. not be used in advertising or publicity pertaining to
607-
distribution of the software without specific, written prior permission.
608-
M.I.T. makes no representations about the suitability of this software for any
609-
purpose. It is provided "as is" without express or implied warranty.
614+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
615+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
616+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
617+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
618+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
619+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
620+
SOFTWARE.
610621
"""
611622

612623
- cjs-module-lexer, located at deps/cjs-module-lexer, is licensed as follows:
@@ -1845,7 +1856,7 @@ The externally maintained libraries used by Node.js are:
18451856

18461857
- ada, located at deps/ada, is licensed as follows:
18471858
"""
1848-
Copyright 2023 Ada authors
1859+
Copyright 2023 Yagiz Nizipli and Daniel Lemire
18491860

18501861
Permission is hereby granted, free of charge, to any person obtaining a copy of
18511862
this software and associated documentation files (the "Software"), to deal in

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ The main focus is on user-observable behavior of the engine.
55
Changelog may include unreleased versions.
66
See [release calendar](https://www.graalvm.org/release-calendar/) for release dates.
77

8+
## Version 24.0.1
9+
* Updated Node.js to version 18.19.1.
10+
811
## Version 24.0.0
912
* Implemented the [WebAssembly threads](https://github.com/WebAssembly/threads) proposal.
1013
* Implemented the [Promise.withResolvers](https://github.com/tc39/proposal-promise-with-resolvers) proposal. It is available in ECMAScript staging mode (`--js.ecmascript-version=staging`).

graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/builtins/AtomicsBuiltins.java

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -125,6 +125,7 @@
125125
public final class AtomicsBuiltins extends JSBuiltinsContainer.SwitchEnum<AtomicsBuiltins.Atomics> {
126126

127127
public static final JSBuiltinsContainer BUILTINS = new AtomicsBuiltins();
128+
public static final JSBuiltinsContainer WAIT_ASYNC_BUILTINS = new WaitAsyncBuiltins();
128129

129130
protected AtomicsBuiltins() {
130131
super(JSRealm.ATOMICS_CLASS_NAME, Atomics.class);
@@ -143,10 +144,7 @@ public enum Atomics implements BuiltinEnum<Atomics> {
143144
wait(4),
144145
isLockFree(1),
145146

146-
notify(3), // ES2019
147-
148-
// Stage 3
149-
waitAsync(4);
147+
notify(3);
150148

151149
private final int length;
152150

@@ -163,8 +161,6 @@ public int getLength() {
163161
public int getECMAScriptVersion() {
164162
if (this.equals(notify)) {
165163
return JSConfig.ECMAScript2019;
166-
} else if (this.equals(waitAsync)) {
167-
return JSConfig.StagingECMAScriptVersion;
168164
}
169165
return JSConfig.ECMAScript2017;
170166
}
@@ -198,12 +194,41 @@ protected Object createNode(JSContext context, JSBuiltin builtin, boolean constr
198194
return AtomicsWaitNodeGen.create(context, builtin, args().fixedArgs(4).createArgumentNodes(context));
199195
case isLockFree:
200196
return AtomicsIsLockFreeNodeGen.create(context, builtin, args().fixedArgs(1).createArgumentNodes(context));
201-
case waitAsync:
202-
return AtomicsWaitAsyncNodeGen.create(context, builtin, args().fixedArgs(4).createArgumentNodes(context));
203197
}
204198
return null;
205199
}
206200

201+
public static final class WaitAsyncBuiltins extends JSBuiltinsContainer.SwitchEnum<WaitAsyncBuiltins.WaitAsync> {
202+
203+
protected WaitAsyncBuiltins() {
204+
super(WaitAsync.class);
205+
}
206+
207+
public enum WaitAsync implements BuiltinEnum<WaitAsync> {
208+
waitAsync(4);
209+
210+
private final int length;
211+
212+
WaitAsync(int length) {
213+
this.length = length;
214+
}
215+
216+
@Override
217+
public int getLength() {
218+
return length;
219+
}
220+
}
221+
222+
@Override
223+
protected Object createNode(JSContext context, JSBuiltin builtin, boolean construct, boolean newTarget, WaitAsync builtinEnum) {
224+
return switch (builtinEnum) {
225+
case waitAsync -> AtomicsWaitAsyncNodeGen.create(context, builtin, args().fixedArgs(4).createArgumentNodes(context));
226+
default -> null;
227+
};
228+
}
229+
230+
}
231+
207232
@ImportStatic(JSArrayBufferView.class)
208233
public abstract static class AtomicsOperationNode extends JSBuiltinNode {
209234

graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/runtime/GraalJSException.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -255,6 +255,11 @@ public void setJSStackTrace(JSStackTraceElement[] jsStackTrace) {
255255
@TruffleBoundary
256256
public static JSStackTraceElement[] getJSStackTrace(Node originatingNode) {
257257
int stackTraceLimit = JavaScriptLanguage.get(originatingNode).getJSContext().getLanguageOptions().stackTraceLimit();
258+
return getJSStackTrace(originatingNode, stackTraceLimit);
259+
}
260+
261+
@TruffleBoundary
262+
public static JSStackTraceElement[] getJSStackTrace(Node originatingNode, int stackTraceLimit) {
258263
return UserScriptException.createCapture("", originatingNode, stackTraceLimit).getJSStackTrace();
259264
}
260265

graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/runtime/JSContextOptions.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -549,6 +549,11 @@ public Map<String, String> apply(String value) {
549549
public static final OptionKey<Boolean> NEW_SET_METHODS = new OptionKey<>(false);
550550
@CompilationFinal private boolean newSetMethods;
551551

552+
public static final String ATOMICS_WAIT_ASYNC_NAME = JS_OPTION_PREFIX + "atomics-wait-async";
553+
@Option(name = ATOMICS_WAIT_ASYNC_NAME, category = OptionCategory.EXPERT, help = "Enable Atomics.waitAsync.") //
554+
public static final OptionKey<Boolean> ATOMICS_WAIT_ASYNC = new OptionKey<>(false);
555+
@CompilationFinal private boolean atomicsWaitAsync;
556+
552557
public static final String TEMPORAL_NAME = JS_OPTION_PREFIX + "temporal";
553558
@Option(name = TEMPORAL_NAME, category = OptionCategory.EXPERT, help = "Enable JavaScript Temporal API.") //
554559
public static final OptionKey<Boolean> TEMPORAL = new OptionKey<>(false);
@@ -746,6 +751,7 @@ private void cacheOptions(SandboxPolicy sandboxPolicy) {
746751
this.webAssembly = readBooleanOption(WEBASSEMBLY);
747752
this.unhandledRejectionsMode = readUnhandledRejectionsMode();
748753
this.newSetMethods = readBooleanOption(NEW_SET_METHODS);
754+
this.atomicsWaitAsync = ATOMICS_WAIT_ASYNC.hasBeenSet(optionValues) ? readBooleanOption(ATOMICS_WAIT_ASYNC) : getEcmaScriptVersion() >= JSConfig.ECMAScript2024;
749755
this.asyncIteratorHelpers = getEcmaScriptVersion() >= JSConfig.ECMAScript2018 && readBooleanOption(ASYNC_ITERATOR_HELPERS);
750756
this.iteratorHelpers = getEcmaScriptVersion() >= JSConfig.ECMAScript2018 && (this.asyncIteratorHelpers || readBooleanOption(ITERATOR_HELPERS));
751757
this.shadowRealm = getEcmaScriptVersion() >= JSConfig.ECMAScript2015 && readBooleanOption(SHADOW_REALM);
@@ -1139,6 +1145,10 @@ public boolean isNewSetMethods() {
11391145
return newSetMethods;
11401146
}
11411147

1148+
public boolean isAtomicsWaitAsync() {
1149+
return atomicsWaitAsync;
1150+
}
1151+
11421152
public boolean isIteratorHelpers() {
11431153
return iteratorHelpers;
11441154
}

graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/runtime/JSRealm.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -2402,6 +2402,9 @@ private JSDynamicObject createAtomics() {
24022402
JSObject obj = JSObjectUtil.createOrdinaryPrototypeObject(this, this.getObjectPrototype());
24032403
JSObjectUtil.putToStringTag(obj, ATOMICS_CLASS_NAME);
24042404
JSObjectUtil.putFunctionsFromContainer(this, obj, AtomicsBuiltins.BUILTINS);
2405+
if (getContextOptions().isAtomicsWaitAsync()) {
2406+
JSObjectUtil.putFunctionsFromContainer(this, obj, AtomicsBuiltins.WAIT_ASYNC_BUILTINS);
2407+
}
24052408
return obj;
24062409
}
24072410

graal-nodejs/.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ tools/lint-md/lint-md.mjs
88
benchmark/tmp
99
benchmark/fixtures
1010
doc/**/*.js
11+
doc/changelogs/CHANGELOG_v1*.md
12+
!doc/changelogs/CHANGELOG_v18.md
1113
!doc/api_assets/*.js
1214
!.eslintrc.js

graal-nodejs/.eslintrc.js

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const hacks = [
1818
'eslint-plugin-jsdoc',
1919
'eslint-plugin-markdown',
2020
'@babel/eslint-parser',
21-
'@babel/plugin-syntax-import-assertions',
21+
'@babel/plugin-syntax-import-attributes',
2222
];
2323
Module._findPath = (request, paths, isMain) => {
2424
const r = ModuleFindPath(request, paths, isMain);
@@ -44,7 +44,10 @@ module.exports = {
4444
parserOptions: {
4545
babelOptions: {
4646
plugins: [
47-
Module._findPath('@babel/plugin-syntax-import-assertions'),
47+
[
48+
Module._findPath('@babel/plugin-syntax-import-attributes'),
49+
{ deprecatedAssertSyntax: true },
50+
],
4851
],
4952
},
5053
requireConfigFile: false,
@@ -53,10 +56,10 @@ module.exports = {
5356
overrides: [
5457
{
5558
files: [
56-
'test/es-module/test-esm-type-flag.js',
57-
'test/es-module/test-esm-type-flag-alias.js',
5859
'*.mjs',
5960
'test/es-module/test-esm-example-loader.js',
61+
'test/es-module/test-esm-type-flag.js',
62+
'test/es-module/test-esm-type-flag-alias.js',
6063
],
6164
parserOptions: { sourceType: 'module' },
6265
},
@@ -111,6 +114,22 @@ module.exports = {
111114
},
112115
] },
113116
},
117+
{
118+
files: [
119+
'lib/internal/modules/**/*.js',
120+
],
121+
rules: {
122+
'curly': 'error',
123+
},
124+
},
125+
{
126+
files: [
127+
'lib/internal/test_runner/**/*.js',
128+
],
129+
rules: {
130+
'node-core/set-proto-to-null-in-object': 'error',
131+
},
132+
},
114133
],
115134
rules: {
116135
// ESLint built-in rules

graal-nodejs/.github/CODEOWNERS

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,19 @@
1111
# tsc
1212

1313
/.github/CODEOWNERS @nodejs/tsc
14+
/.github/PULL_REQUEST_TEMPLATE.md @nodejs/tsc
15+
/.github/ISSUE_TEMPLATE/* @nodejs/tsc
1416
/CODE_OF_CONDUCT.md @nodejs/tsc
1517
/CONTRIBUTING.md @nodejs/tsc
1618
/doc/contributing/*.md @nodejs/tsc
1719
/GOVERNANCE.md @nodejs/tsc
1820
/LICENSE @nodejs/tsc
1921
/onboarding.md @nodejs/tsc
2022

21-
# website
22-
/doc/api_assets @nodejs/website
23-
/doc/template.html @nodejs/website
24-
/tools/doc @nodejs/website
23+
# nodejs.org website
24+
/doc/api_assets @nodejs/nodejs-website
25+
/doc/template.html @nodejs/nodejs-website
26+
/tools/doc @nodejs/web-infra
2527

2628
# streams
2729

@@ -85,16 +87,16 @@
8587

8688
# modules, including loaders
8789

88-
/doc/api/esm.md @nodejs/modules @nodejs/loaders
89-
/doc/api/module.md @nodejs/modules @nodejs/loaders
90-
/doc/api/modules.md @nodejs/modules @nodejs/loaders
91-
/doc/api/packages.md @nodejs/modules @nodejs/loaders
92-
/lib/internal/bootstrap/loaders.js @nodejs/modules @nodejs/loaders
93-
/lib/internal/modules/* @nodejs/modules @nodejs/loaders
94-
/lib/internal/process/esm_loader.js @nodejs/modules @nodejs/loaders
95-
/lib/internal/process/execution.js @nodejs/modules @nodejs/loaders
96-
/lib/module.js @nodejs/modules @nodejs/loaders
97-
/src/module_wrap* @nodejs/modules @nodejs/loaders @nodejs/vm
90+
/doc/api/esm.md @nodejs/loaders
91+
/doc/api/module.md @nodejs/loaders
92+
/doc/api/modules.md @nodejs/loaders
93+
/doc/api/packages.md @nodejs/loaders
94+
/lib/internal/bootstrap/realm.js @nodejs/loaders
95+
/lib/internal/modules/* @nodejs/loaders
96+
/lib/internal/process/esm_loader.js @nodejs/loaders
97+
/lib/internal/process/execution.js @nodejs/loaders
98+
/lib/module.js @nodejs/loaders
99+
/src/module_wrap* @nodejs/loaders @nodejs/vm
98100

99101
# Node-API
100102

@@ -146,6 +148,7 @@
146148
/lib/internal/main/test_runner.js @nodejs/test_runner
147149
/lib/internal/test_runner/* @nodejs/test_runner
148150
/lib/test.js @nodejs/test_runner
151+
/lib/test/reporters.js @nodejs/test_runner
149152
/test/parallel/test-runner-* @nodejs/test_runner
150153

151154
# Single Executable Applications

graal-nodejs/.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
<!--
2-
Before submitting a pull request, please read
3-
https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md.
2+
Before submitting a pull request, please read:
43
5-
Commit message formatting guidelines:
6-
https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines
4+
- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
5+
- the commit message formatting guidelines at
6+
https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines
77
88
For code changes:
99
1. Include tests for any bug fixes or new features.
1010
2. Update documentation if relevant.
1111
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.
1212
13+
If you believe this PR should be highlighted in the Node.js CHANGELOG
14+
please add the `notable-change` label.
15+
1316
Developer's Certificate of Origin 1.1
1417
1518
By making a contribution to this project, I certify that:

0 commit comments

Comments
 (0)