Compare commits

..

5 Commits

Author SHA1 Message Date
yureiblack
128880988e test: correct typo in node-spec.ts comment (#49141)
fix: correct typo in node-spec.ts comment
2026-02-25 23:03:06 -08:00
Shelley Vohr
8d05285a1f fix: potential std::stoi crash in Windows Toasts (#49947)
fix: potential std::stoi crash in Windows Toasts
2026-02-25 14:14:45 -08:00
Mitchell Cohen
6a2571ee3d ci: Wayland test job, helpers, and app spec (#49908)
* wayland test chromium patch

* ci: add wayland test job and helpers

* use weston directly instead of wlheadless-run

* roll build image to eac3529

* fixed exec command

* Update .github/workflows/pipeline-segment-electron-test.yml

Co-authored-by: John Kleinschmidt <kleinschmidtorama@gmail.com>

* Update .github/workflows/pipeline-segment-electron-test.yml

Co-authored-by: John Kleinschmidt <kleinschmidtorama@gmail.com>

* chore: fixup shard case statement

* reverted leftover patch line

---------

Co-authored-by: John Kleinschmidt <kleinschmidtorama@gmail.com>
2026-02-25 14:51:13 -05:00
Shelley Vohr
94aa90bb64 fix: recover network requests after Network Service restart (#49887)
* fix: recover network requests after Network Service restart

* chore: reuse implementation

* chore: make linter happy

* chore: fix lint

---------

Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2026-02-25 12:53:06 -05:00
zonescape
b9a09acff3 docs: mark "Show hidden files" file dialog setting as deprecated on Linux (#46926)
* fix: don't overwrite "Show hidden files" setting on Linux/GTK

* docs: deprecate showHiddenFiles property in dialogs on Linux

* docs: mark Electron 42 as the removal date for this feature

---------

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2026-02-25 11:05:01 -05:00
64 changed files with 493 additions and 282 deletions

View File

@@ -2,7 +2,7 @@ version: '3'
services: services:
buildtools: buildtools:
image: ghcr.io/electron/devcontainer:a82b87d7a4f5ff0cab61405f8151ac4cf4942aeb image: ghcr.io/electron/devcontainer:eac3529546ea8f3aa356d31e345715eef342233b
volumes: volumes:
- ..:/workspaces/gclient/src/electron:cached - ..:/workspaces/gclient/src/electron:cached

View File

@@ -41,7 +41,7 @@ jobs:
permissions: permissions:
contents: read contents: read
container: container:
image: ghcr.io/electron/build:a82b87d7a4f5ff0cab61405f8151ac4cf4942aeb image: ghcr.io/electron/build:eac3529546ea8f3aa356d31e345715eef342233b
options: --user root options: --user root
volumes: volumes:
- /mnt/cross-instance-cache:/mnt/cross-instance-cache - /mnt/cross-instance-cache:/mnt/cross-instance-cache

View File

@@ -15,7 +15,7 @@ jobs:
permissions: permissions:
contents: read contents: read
container: container:
image: ghcr.io/electron/build:a82b87d7a4f5ff0cab61405f8151ac4cf4942aeb image: ghcr.io/electron/build:eac3529546ea8f3aa356d31e345715eef342233b
options: --user root options: --user root
volumes: volumes:
- /mnt/cross-instance-cache:/mnt/cross-instance-cache - /mnt/cross-instance-cache:/mnt/cross-instance-cache
@@ -39,7 +39,7 @@ jobs:
permissions: permissions:
contents: read contents: read
container: container:
image: ghcr.io/electron/build:a82b87d7a4f5ff0cab61405f8151ac4cf4942aeb image: ghcr.io/electron/build:eac3529546ea8f3aa356d31e345715eef342233b
options: --user root --device /dev/fuse --cap-add SYS_ADMIN options: --user root --device /dev/fuse --cap-add SYS_ADMIN
volumes: volumes:
- /mnt/win-cache:/mnt/win-cache - /mnt/win-cache:/mnt/win-cache
@@ -66,7 +66,7 @@ jobs:
# This job updates the same git cache as linux, so it needs to run after the linux one. # This job updates the same git cache as linux, so it needs to run after the linux one.
needs: build-git-cache-linux needs: build-git-cache-linux
container: container:
image: ghcr.io/electron/build:a82b87d7a4f5ff0cab61405f8151ac4cf4942aeb image: ghcr.io/electron/build:eac3529546ea8f3aa356d31e345715eef342233b
options: --user root options: --user root
volumes: volumes:
- /mnt/cross-instance-cache:/mnt/cross-instance-cache - /mnt/cross-instance-cache:/mnt/cross-instance-cache

View File

@@ -6,7 +6,7 @@ on:
build-image-sha: build-image-sha:
type: string type: string
description: 'SHA for electron/build image' description: 'SHA for electron/build image'
default: 'a82b87d7a4f5ff0cab61405f8151ac4cf4942aeb' default: 'eac3529546ea8f3aa356d31e345715eef342233b'
required: true required: true
skip-macos: skip-macos:
type: boolean type: boolean
@@ -77,7 +77,7 @@ jobs:
id: set-output id: set-output
run: | run: |
if [ -z "${{ inputs.build-image-sha }}" ]; then if [ -z "${{ inputs.build-image-sha }}" ]; then
echo "build-image-sha=a82b87d7a4f5ff0cab61405f8151ac4cf4942aeb" >> "$GITHUB_OUTPUT" echo "build-image-sha=eac3529546ea8f3aa356d31e345715eef342233b" >> "$GITHUB_OUTPUT"
else else
echo "build-image-sha=${{ inputs.build-image-sha }}" >> "$GITHUB_OUTPUT" echo "build-image-sha=${{ inputs.build-image-sha }}" >> "$GITHUB_OUTPUT"
fi fi

View File

@@ -6,7 +6,7 @@ on:
build-image-sha: build-image-sha:
type: string type: string
description: 'SHA for electron/build image' description: 'SHA for electron/build image'
default: 'a82b87d7a4f5ff0cab61405f8151ac4cf4942aeb' default: 'eac3529546ea8f3aa356d31e345715eef342233b'
upload-to-storage: upload-to-storage:
description: 'Uploads to Azure storage' description: 'Uploads to Azure storage'
required: false required: false

View File

@@ -6,7 +6,7 @@ on:
build-image-sha: build-image-sha:
type: string type: string
description: 'SHA for electron/build image' description: 'SHA for electron/build image'
default: 'a82b87d7a4f5ff0cab61405f8151ac4cf4942aeb' default: 'eac3529546ea8f3aa356d31e345715eef342233b'
required: true required: true
upload-to-storage: upload-to-storage:
description: 'Uploads to Azure storage' description: 'Uploads to Azure storage'

View File

@@ -110,6 +110,21 @@ jobs:
test-runs-on: ${{ inputs.test-runs-on }} test-runs-on: ${{ inputs.test-runs-on }}
test-container: ${{ inputs.test-container }} test-container: ${{ inputs.test-container }}
secrets: inherit secrets: inherit
test-wayland:
uses: ./.github/workflows/pipeline-segment-electron-test.yml
permissions:
contents: read
issues: read
pull-requests: read
needs: build
if: ${{ inputs.target-platform == 'linux' && inputs.target-arch == 'x64' && !inputs.is-asan }}
with:
target-arch: ${{ inputs.target-arch }}
target-platform: ${{ inputs.target-platform }}
test-runs-on: ${{ inputs.test-runs-on }}
test-container: ${{ inputs.test-container }}
display-server: wayland
secrets: inherit
nn-test: nn-test:
uses: ./.github/workflows/pipeline-segment-node-nan-test.yml uses: ./.github/workflows/pipeline-segment-node-nan-test.yml
permissions: permissions:

View File

@@ -30,9 +30,14 @@ on:
required: false required: false
type: boolean type: boolean
default: false default: false
display-server:
description: 'Display backend for Linux tests: x11 or wayland'
required: false
type: string
default: x11
concurrency: concurrency:
group: electron-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ inputs.is-asan }}-${{ github.ref_protected == true && github.run_id || github.ref }} group: electron-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ inputs.is-asan }}-${{ inputs.display-server }}-${{ github.ref_protected == true && github.run_id || github.ref }}
cancel-in-progress: ${{ github.ref_protected != true }} cancel-in-progress: ${{ github.ref_protected != true }}
permissions: {} permissions: {}
@@ -59,7 +64,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
build-type: ${{ inputs.target-platform == 'macos' && fromJSON('["darwin","mas"]') || (inputs.target-platform == 'win' && fromJSON('["win"]') || fromJSON('["linux"]')) }} build-type: ${{ inputs.target-platform == 'macos' && fromJSON('["darwin","mas"]') || (inputs.target-platform == 'win' && fromJSON('["win"]') || fromJSON('["linux"]')) }}
shard: ${{ inputs.target-platform == 'linux' && fromJSON('[1, 2, 3]') || fromJSON('[1, 2]') }} shard: ${{ case(inputs.display-server == 'wayland', fromJSON('[1]'), inputs.target-platform == 'linux', fromJSON('[1, 2, 3]'), fromJSON('[1, 2]')) }}
env: env:
BUILD_TYPE: ${{ matrix.build-type }} BUILD_TYPE: ${{ matrix.build-type }}
TARGET_ARCH: ${{ inputs.target-arch }} TARGET_ARCH: ${{ inputs.target-arch }}
@@ -210,7 +215,22 @@ jobs:
cd src/electron cd src/electron
export ELECTRON_TEST_RESULTS_DIR=`pwd`/junit export ELECTRON_TEST_RESULTS_DIR=`pwd`/junit
# Get which tests are on this shard # Get which tests are on this shard
tests_files=$(node script/split-tests ${{ matrix.shard }} ${{ inputs.target-platform == 'linux' && 3 || 2 }}) tests_files=$(node script/split-tests ${{ matrix.shard }} ${{ case(inputs.display-server == 'wayland', 1, inputs.target-platform == 'linux', 3, 2) }})
if [ "${{ inputs.display-server }}" = "wayland" ]; then
allowlist_file=script/wayland-test-allowlist.txt
filtered_tests=""
for test_file in $tests_files; do
if grep -Fxq "$test_file" "$allowlist_file"; then
filtered_tests="$filtered_tests $test_file"
fi
done
tests_files="${filtered_tests# }"
if [ -z "$tests_files" ]; then
echo "No tests matched Wayland filter, skipping."
exit 0
fi
fi
# Run tests # Run tests
if [ "${{ inputs.target-platform }}" != "linux" ]; then if [ "${{ inputs.target-platform }}" != "linux" ]; then
@@ -245,7 +265,11 @@ jobs:
if [ "${{ inputs.target-arch }}" = "arm" ]; then if [ "${{ inputs.target-arch }}" = "arm" ]; then
runuser -u builduser -- xvfb-run script/actions/run-tests.sh script/yarn.js test --skipYarnInstall --runners=main --enableRerun=3 --trace-uncaught --enable-logging --files $tests_files runuser -u builduser -- xvfb-run script/actions/run-tests.sh script/yarn.js test --skipYarnInstall --runners=main --enableRerun=3 --trace-uncaught --enable-logging --files $tests_files
else else
runuser -u builduser -- xvfb-run script/actions/run-tests.sh script/yarn.js test --runners=main --enableRerun=3 --trace-uncaught --enable-logging --files $tests_files if [ "${{ inputs.display-server }}" = "wayland" ]; then
runuser -u builduser -- script/actions/run-tests-wayland.sh script/yarn.js test --runners=main --enableRerun=3 --trace-uncaught --enable-logging --files $tests_files
else
runuser -u builduser -- xvfb-run script/actions/run-tests.sh script/yarn.js test --runners=main --enableRerun=3 --trace-uncaught --enable-logging --files $tests_files
fi
fi fi
fi fi
@@ -268,7 +292,7 @@ jobs:
if: always() && !cancelled() if: always() && !cancelled()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with: with:
name: test_artifacts_${{ env.ARTIFACT_KEY }}_${{ matrix.shard }} name: ${{ inputs.target-platform == 'linux' && format('test_artifacts_{0}_{1}_{2}', env.ARTIFACT_KEY, inputs.display-server, matrix.shard) || format('test_artifacts_{0}_{1}', env.ARTIFACT_KEY, matrix.shard) }}
path: src/electron/spec/artifacts path: src/electron/spec/artifacts
if-no-files-found: ignore if-no-files-found: ignore
- name: Wait for active SSH sessions - name: Wait for active SSH sessions

View File

@@ -6,7 +6,7 @@ on:
build-image-sha: build-image-sha:
type: string type: string
description: 'SHA for electron/build image' description: 'SHA for electron/build image'
default: 'a82b87d7a4f5ff0cab61405f8151ac4cf4942aeb' default: 'eac3529546ea8f3aa356d31e345715eef342233b'
required: true required: true
upload-to-storage: upload-to-storage:
description: 'Uploads to Azure storage' description: 'Uploads to Azure storage'

2
DEPS
View File

@@ -4,7 +4,7 @@ vars = {
'chromium_version': 'chromium_version':
'147.0.7699.0', '147.0.7699.0',
'node_version': 'node_version':
'v24.14.0', 'v24.13.1',
'nan_version': 'nan_version':
'675cefebca42410733da8a454c8d9391fcebfbc2', '675cefebca42410733da8a454c8d9391fcebfbc2',
'squirrel.mac_version': 'squirrel.mac_version':

View File

@@ -30,7 +30,7 @@ The `dialog` module has the following methods:
* `openFile` - Allow files to be selected. * `openFile` - Allow files to be selected.
* `openDirectory` - Allow directories to be selected. * `openDirectory` - Allow directories to be selected.
* `multiSelections` - Allow multiple paths to be selected. * `multiSelections` - Allow multiple paths to be selected.
* `showHiddenFiles` - Show hidden files in dialog. * `showHiddenFiles` _macOS_ _Windows_ _Deprecated_ - Show hidden files in dialog. Deprecated on Linux.
* `createDirectory` _macOS_ - Allow creating new directories from dialog. * `createDirectory` _macOS_ - Allow creating new directories from dialog.
* `promptToCreate` _Windows_ - Prompt for creation if the file path entered * `promptToCreate` _Windows_ - Prompt for creation if the file path entered
in the dialog does not exist. This does not actually create the file at in the dialog does not exist. This does not actually create the file at
@@ -102,7 +102,7 @@ dialog.showOpenDialogSync(mainWindow, {
* `openFile` - Allow files to be selected. * `openFile` - Allow files to be selected.
* `openDirectory` - Allow directories to be selected. * `openDirectory` - Allow directories to be selected.
* `multiSelections` - Allow multiple paths to be selected. * `multiSelections` - Allow multiple paths to be selected.
* `showHiddenFiles` - Show hidden files in dialog. * `showHiddenFiles` _macOS_ _Windows_ _Deprecated_ - Show hidden files in dialog. Deprecated on Linux.
* `createDirectory` _macOS_ - Allow creating new directories from dialog. * `createDirectory` _macOS_ - Allow creating new directories from dialog.
* `promptToCreate` _Windows_ - Prompt for creation if the file path entered * `promptToCreate` _Windows_ - Prompt for creation if the file path entered
in the dialog does not exist. This does not actually create the file at in the dialog does not exist. This does not actually create the file at
@@ -185,7 +185,7 @@ dialog.showOpenDialog(mainWindow, {
* `showsTagField` boolean (optional) _macOS_ - Show the tags input box, * `showsTagField` boolean (optional) _macOS_ - Show the tags input box,
defaults to `true`. defaults to `true`.
* `properties` string[]&#32;(optional) * `properties` string[]&#32;(optional)
* `showHiddenFiles` - Show hidden files in dialog. * `showHiddenFiles` _macOS_ _Windows_ _Deprecated_ - Show hidden files in dialog. Deprecated on Linux.
* `createDirectory` _macOS_ - Allow creating new directories from dialog. * `createDirectory` _macOS_ - Allow creating new directories from dialog.
* `treatPackageAsDirectory` _macOS_ - Treat packages, such as `.app` folders, * `treatPackageAsDirectory` _macOS_ - Treat packages, such as `.app` folders,
as a directory instead of a file. as a directory instead of a file.
@@ -215,7 +215,7 @@ The `filters` specifies an array of file types that can be displayed, see
displayed in front of the filename text field. displayed in front of the filename text field.
* `showsTagField` boolean (optional) _macOS_ - Show the tags input box, defaults to `true`. * `showsTagField` boolean (optional) _macOS_ - Show the tags input box, defaults to `true`.
* `properties` string[]&#32;(optional) * `properties` string[]&#32;(optional)
* `showHiddenFiles` - Show hidden files in dialog. * `showHiddenFiles` _macOS_ _Windows_ _Deprecated_ - Show hidden files in dialog. Deprecated on Linux.
* `createDirectory` _macOS_ - Allow creating new directories from dialog. * `createDirectory` _macOS_ - Allow creating new directories from dialog.
* `treatPackageAsDirectory` _macOS_ - Treat packages, such as `.app` folders, * `treatPackageAsDirectory` _macOS_ - Treat packages, such as `.app` folders,
as a directory instead of a file. as a directory instead of a file.

View File

@@ -80,6 +80,12 @@ your preload script and expose it using the [contextBridge](https://www.electron
Debug symbols for MacOS (dSYM) now use xz compression in order to handle larger file sizes. `dsym.zip` files are now Debug symbols for MacOS (dSYM) now use xz compression in order to handle larger file sizes. `dsym.zip` files are now
`dsym.tar.xz` files. End users using debug symbols may need to update their zip utilities. `dsym.tar.xz` files. End users using debug symbols may need to update their zip utilities.
### Deprecated: `showHiddenFiles` in Dialogs on Linux
This property will still be honored on macOS and Windows, but support on Linux
will be removed in Electron 42. GTK intends for this to be a user choice rather
than an app choice and has removed the API to do this programmatically.
## Planned Breaking API Changes (39.0) ## Planned Breaking API Changes (39.0)
### Deprecated: `--host-rules` command line switch ### Deprecated: `--host-rules` command line switch

View File

@@ -144,3 +144,4 @@ fix_linux_tray_id.patch
expose_gtk_ui_platform_field.patch expose_gtk_ui_platform_field.patch
patch_osr_control_screen_info.patch patch_osr_control_screen_info.patch
refactor_allow_customizing_config_in_freedesktopsecretkeyprovider.patch refactor_allow_customizing_config_in_freedesktopsecretkeyprovider.patch
fix_wayland_test_crash_on_teardown.patch

View File

@@ -6,10 +6,10 @@ Subject: build: allow electron to use exec_script
This is similar to the //build usecase so we're OK adding ourselves here This is similar to the //build usecase so we're OK adding ourselves here
diff --git a/.gn b/.gn diff --git a/.gn b/.gn
index ae58a0b0a64ae1fdb3f9cd8587041d71a121c6b9..f9d4e9b015ad266452dfa2a442b432ef31d09a5b 100644 index ae58a0b0a64ae1fdb3f9cd8587041d71a121c6b9..0ed56526002b12deb6d29f3dd23a0d74d8e7473c 100644
--- a/.gn --- a/.gn
+++ b/.gn +++ b/.gn
@@ -167,4 +167,28 @@ exec_script_allowlist = @@ -167,4 +167,27 @@ exec_script_allowlist =
"//tools/grit/grit_rule.gni", "//tools/grit/grit_rule.gni",
"//tools/gritsettings/BUILD.gn", "//tools/gritsettings/BUILD.gn",
@@ -25,7 +25,6 @@ index ae58a0b0a64ae1fdb3f9cd8587041d71a121c6b9..f9d4e9b015ad266452dfa2a442b432ef
+ "//third_party/electron_node/deps/googletest/unofficial.gni", + "//third_party/electron_node/deps/googletest/unofficial.gni",
+ "//third_party/electron_node/deps/histogram/unofficial.gni", + "//third_party/electron_node/deps/histogram/unofficial.gni",
+ "//third_party/electron_node/deps/llhttp/unofficial.gni", + "//third_party/electron_node/deps/llhttp/unofficial.gni",
+ "//third_party/electron_node/deps/merve/unofficial.gni",
+ "//third_party/electron_node/deps/nbytes/unofficial.gni", + "//third_party/electron_node/deps/nbytes/unofficial.gni",
+ "//third_party/electron_node/deps/ncrypto/unofficial.gni", + "//third_party/electron_node/deps/ncrypto/unofficial.gni",
+ "//third_party/electron_node/deps/nghttp2/unofficial.gni", + "//third_party/electron_node/deps/nghttp2/unofficial.gni",

View File

@@ -0,0 +1,20 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mitchell Cohen <mitch.cohen@me.com>
Date: Sun, 22 Feb 2026 11:38:49 -0500
Subject: fix: Wayland test crash on teardown
Allows Wayland test job to teardown the connection without crashing when trying to update the pointer
diff --git a/ui/ozone/platform/wayland/host/wayland_connection.cc b/ui/ozone/platform/wayland/host/wayland_connection.cc
index 4c44eaeebe091906a1676da106faa9072819b67e..224f6abfe06794d31fc4d876c8242dab79ba075d 100644
--- a/ui/ozone/platform/wayland/host/wayland_connection.cc
+++ b/ui/ozone/platform/wayland/host/wayland_connection.cc
@@ -426,7 +426,7 @@ std::vector<TouchscreenDevice> WaylandConnection::CreateTouchscreenDevices()
}
void WaylandConnection::UpdateCursor() {
- if (auto* pointer = seat_->pointer()) {
+ if (auto* pointer = seat_ ? seat_->pointer() : nullptr) {
cursor_ = std::make_unique<WaylandCursor>(pointer, this);
cursor_->set_listener(listener_);
cursor_position_ = std::make_unique<WaylandCursorPosition>();

View File

@@ -6,7 +6,7 @@ Subject: Delete deprecated fields on v8::Isolate
https://chromium-review.googlesource.com/c/v8/v8/+/7081397 https://chromium-review.googlesource.com/c/v8/v8/+/7081397
diff --git a/src/api/environment.cc b/src/api/environment.cc diff --git a/src/api/environment.cc b/src/api/environment.cc
index 2111ee63a6ace438c1a143c90a807ed9fc2bcc9d..ce6426a1bf2dadb1a642874a05718724ef0f3d7c 100644 index cfc9b3157d08d62f43e2e5bb01229fe663f3ca61..cce0e1cdc37aa324aa2c52ba134fc1a9a55b10ba 100644
--- a/src/api/environment.cc --- a/src/api/environment.cc
+++ b/src/api/environment.cc +++ b/src/api/environment.cc
@@ -218,8 +218,6 @@ void SetIsolateCreateParamsForNode(Isolate::CreateParams* params) { @@ -218,8 +218,6 @@ void SetIsolateCreateParamsForNode(Isolate::CreateParams* params) {

View File

@@ -6,10 +6,10 @@ Subject: Remove deprecated `GetIsolate`
https://chromium-review.googlesource.com/c/v8/v8/+/6905244 https://chromium-review.googlesource.com/c/v8/v8/+/6905244
diff --git a/src/api/environment.cc b/src/api/environment.cc diff --git a/src/api/environment.cc b/src/api/environment.cc
index 8974bac7dca43294cc5cc4570f8e2e78f42aefaa..2111ee63a6ace438c1a143c90a807ed9fc2bcc9d 100644 index d753ad6c6b49b26b86920124f7ac90c1e052638e..cfc9b3157d08d62f43e2e5bb01229fe663f3ca61 100644
--- a/src/api/environment.cc --- a/src/api/environment.cc
+++ b/src/api/environment.cc +++ b/src/api/environment.cc
@@ -795,7 +795,7 @@ std::unique_ptr<MultiIsolatePlatform> MultiIsolatePlatform::Create( @@ -668,7 +668,7 @@ std::unique_ptr<MultiIsolatePlatform> MultiIsolatePlatform::Create(
MaybeLocal<Object> GetPerContextExports(Local<Context> context, MaybeLocal<Object> GetPerContextExports(Local<Context> context,
IsolateData* isolate_data) { IsolateData* isolate_data) {
@@ -18,7 +18,7 @@ index 8974bac7dca43294cc5cc4570f8e2e78f42aefaa..2111ee63a6ace438c1a143c90a807ed9
EscapableHandleScope handle_scope(isolate); EscapableHandleScope handle_scope(isolate);
Local<Object> global = context->Global(); Local<Object> global = context->Global();
@@ -841,7 +841,7 @@ void ProtoThrower(const FunctionCallbackInfo<Value>& info) { @@ -714,7 +714,7 @@ void ProtoThrower(const FunctionCallbackInfo<Value>& info) {
// This runs at runtime, regardless of whether the context // This runs at runtime, regardless of whether the context
// is created from a snapshot. // is created from a snapshot.
Maybe<void> InitializeContextRuntime(Local<Context> context) { Maybe<void> InitializeContextRuntime(Local<Context> context) {
@@ -27,7 +27,7 @@ index 8974bac7dca43294cc5cc4570f8e2e78f42aefaa..2111ee63a6ace438c1a143c90a807ed9
HandleScope handle_scope(isolate); HandleScope handle_scope(isolate);
// When `IsCodeGenerationFromStringsAllowed` is true, V8 takes the fast path // When `IsCodeGenerationFromStringsAllowed` is true, V8 takes the fast path
@@ -920,7 +920,7 @@ Maybe<void> InitializeContextRuntime(Local<Context> context) { @@ -793,7 +793,7 @@ Maybe<void> InitializeContextRuntime(Local<Context> context) {
} }
Maybe<void> InitializeBaseContextForSnapshot(Local<Context> context) { Maybe<void> InitializeBaseContextForSnapshot(Local<Context> context) {
@@ -36,7 +36,7 @@ index 8974bac7dca43294cc5cc4570f8e2e78f42aefaa..2111ee63a6ace438c1a143c90a807ed9
HandleScope handle_scope(isolate); HandleScope handle_scope(isolate);
// Delete `Intl.v8BreakIterator` // Delete `Intl.v8BreakIterator`
@@ -945,7 +945,7 @@ Maybe<void> InitializeBaseContextForSnapshot(Local<Context> context) { @@ -818,7 +818,7 @@ Maybe<void> InitializeBaseContextForSnapshot(Local<Context> context) {
} }
Maybe<void> InitializeMainContextForSnapshot(Local<Context> context) { Maybe<void> InitializeMainContextForSnapshot(Local<Context> context) {
@@ -45,7 +45,7 @@ index 8974bac7dca43294cc5cc4570f8e2e78f42aefaa..2111ee63a6ace438c1a143c90a807ed9
HandleScope handle_scope(isolate); HandleScope handle_scope(isolate);
// Initialize the default values. // Initialize the default values.
@@ -963,7 +963,7 @@ Maybe<void> InitializeMainContextForSnapshot(Local<Context> context) { @@ -836,7 +836,7 @@ Maybe<void> InitializeMainContextForSnapshot(Local<Context> context) {
MaybeLocal<Object> InitializePrivateSymbols(Local<Context> context, MaybeLocal<Object> InitializePrivateSymbols(Local<Context> context,
IsolateData* isolate_data) { IsolateData* isolate_data) {
CHECK(isolate_data); CHECK(isolate_data);
@@ -54,7 +54,7 @@ index 8974bac7dca43294cc5cc4570f8e2e78f42aefaa..2111ee63a6ace438c1a143c90a807ed9
EscapableHandleScope scope(isolate); EscapableHandleScope scope(isolate);
Context::Scope context_scope(context); Context::Scope context_scope(context);
@@ -987,7 +987,7 @@ MaybeLocal<Object> InitializePrivateSymbols(Local<Context> context, @@ -860,7 +860,7 @@ MaybeLocal<Object> InitializePrivateSymbols(Local<Context> context,
MaybeLocal<Object> InitializePerIsolateSymbols(Local<Context> context, MaybeLocal<Object> InitializePerIsolateSymbols(Local<Context> context,
IsolateData* isolate_data) { IsolateData* isolate_data) {
CHECK(isolate_data); CHECK(isolate_data);
@@ -63,7 +63,7 @@ index 8974bac7dca43294cc5cc4570f8e2e78f42aefaa..2111ee63a6ace438c1a143c90a807ed9
EscapableHandleScope scope(isolate); EscapableHandleScope scope(isolate);
Context::Scope context_scope(context); Context::Scope context_scope(context);
@@ -1013,7 +1013,7 @@ MaybeLocal<Object> InitializePerIsolateSymbols(Local<Context> context, @@ -886,7 +886,7 @@ MaybeLocal<Object> InitializePerIsolateSymbols(Local<Context> context,
Maybe<void> InitializePrimordials(Local<Context> context, Maybe<void> InitializePrimordials(Local<Context> context,
IsolateData* isolate_data) { IsolateData* isolate_data) {
// Run per-context JS files. // Run per-context JS files.
@@ -120,10 +120,10 @@ index 4c5427596d1c90d3a413cdd9ff4f1151e657073d..70135a6be65e41fcb3564ddf6d1e8083
NewStringType::kNormal, NewStringType::kNormal,
mem->length) mem->length)
diff --git a/src/encoding_binding.cc b/src/encoding_binding.cc diff --git a/src/encoding_binding.cc b/src/encoding_binding.cc
index 6fe4f0492dc1f3eaf576c8ff7866080a54cb81c1..41e8e052ff81df78ece87163b0499966cc2ed1b9 100644 index a913e34c73db3fb62aedcf28bee1bf1c4d59de7a..9de38eb9907269e99fdf0907aa35862572a2c643 100644
--- a/src/encoding_binding.cc --- a/src/encoding_binding.cc
+++ b/src/encoding_binding.cc +++ b/src/encoding_binding.cc
@@ -76,7 +76,7 @@ void BindingData::Deserialize(Local<Context> context, @@ -75,7 +75,7 @@ void BindingData::Deserialize(Local<Context> context,
int index, int index,
InternalFieldInfoBase* info) { InternalFieldInfoBase* info) {
DCHECK_IS_SNAPSHOT_SLOT(index); DCHECK_IS_SNAPSHOT_SLOT(index);
@@ -353,10 +353,10 @@ index 52483740bb377a2bc2a16af701615d9a4e448eae..84d17a46efe146c1794a43963c41a446
CHECK(!env->temporary_required_module_facade_original.IsEmpty()); CHECK(!env->temporary_required_module_facade_original.IsEmpty());
return env->temporary_required_module_facade_original.Get(isolate); return env->temporary_required_module_facade_original.Get(isolate);
diff --git a/src/node.h b/src/node.h diff --git a/src/node.h b/src/node.h
index bbe35c7a8f1bc0bcddf628af42b71efaef8a7759..102bcc0b3400fd334bdf259a076a3ac3b5d4a266 100644 index 5a6004ca4dfd15a813f3fcc7687958432e4fd5a0..ee4eb270eeb5a76415e74ac6322e0cb347fe60ce 100644
--- a/src/node.h --- a/src/node.h
+++ b/src/node.h +++ b/src/node.h
@@ -1142,7 +1142,7 @@ NODE_DEPRECATED("Use v8::Date::ValueOf() directly", @@ -1064,7 +1064,7 @@ NODE_DEPRECATED("Use v8::Date::ValueOf() directly",
#define NODE_DEFINE_CONSTANT(target, constant) \ #define NODE_DEFINE_CONSTANT(target, constant) \
do { \ do { \
@@ -365,7 +365,7 @@ index bbe35c7a8f1bc0bcddf628af42b71efaef8a7759..102bcc0b3400fd334bdf259a076a3ac3
v8::Local<v8::Context> context = isolate->GetCurrentContext(); \ v8::Local<v8::Context> context = isolate->GetCurrentContext(); \
v8::Local<v8::String> constant_name = v8::String::NewFromUtf8Literal( \ v8::Local<v8::String> constant_name = v8::String::NewFromUtf8Literal( \
isolate, #constant, v8::NewStringType::kInternalized); \ isolate, #constant, v8::NewStringType::kInternalized); \
@@ -1158,7 +1158,7 @@ NODE_DEPRECATED("Use v8::Date::ValueOf() directly", @@ -1080,7 +1080,7 @@ NODE_DEPRECATED("Use v8::Date::ValueOf() directly",
#define NODE_DEFINE_HIDDEN_CONSTANT(target, constant) \ #define NODE_DEFINE_HIDDEN_CONSTANT(target, constant) \
do { \ do { \
@@ -375,10 +375,10 @@ index bbe35c7a8f1bc0bcddf628af42b71efaef8a7759..102bcc0b3400fd334bdf259a076a3ac3
v8::Local<v8::String> constant_name = v8::String::NewFromUtf8Literal( \ v8::Local<v8::String> constant_name = v8::String::NewFromUtf8Literal( \
isolate, #constant, v8::NewStringType::kInternalized); \ isolate, #constant, v8::NewStringType::kInternalized); \
diff --git a/src/node_blob.cc b/src/node_blob.cc diff --git a/src/node_blob.cc b/src/node_blob.cc
index 4311d71bb0526f9a83a16525243446a590092910..417cd8cbd307b9bfc498ad2df24ed193616ac512 100644 index d278a32c9934c15bc721da164efccca7bc7e7111..ab862bf93a411e6ae6da7c9f9706cee279a0ad70 100644
--- a/src/node_blob.cc --- a/src/node_blob.cc
+++ b/src/node_blob.cc +++ b/src/node_blob.cc
@@ -562,7 +562,7 @@ void BlobBindingData::Deserialize(Local<Context> context, @@ -554,7 +554,7 @@ void BlobBindingData::Deserialize(Local<Context> context,
int index, int index,
InternalFieldInfoBase* info) { InternalFieldInfoBase* info) {
DCHECK_IS_SNAPSHOT_SLOT(index); DCHECK_IS_SNAPSHOT_SLOT(index);
@@ -388,10 +388,10 @@ index 4311d71bb0526f9a83a16525243446a590092910..417cd8cbd307b9bfc498ad2df24ed193
BlobBindingData* binding = realm->AddBindingData<BlobBindingData>(holder); BlobBindingData* binding = realm->AddBindingData<BlobBindingData>(holder);
CHECK_NOT_NULL(binding); CHECK_NOT_NULL(binding);
diff --git a/src/node_builtins.cc b/src/node_builtins.cc diff --git a/src/node_builtins.cc b/src/node_builtins.cc
index 3377d697615ee168e49e83c4202bc227581f1aaf..1a9a57b73e635ac61016598687167a08b073f84a 100644 index 703ac1be06249736073f797058d170576a0db1bf..f0607ec9fd1983386166d0f4782adac99ace943e 100644
--- a/src/node_builtins.cc --- a/src/node_builtins.cc
+++ b/src/node_builtins.cc +++ b/src/node_builtins.cc
@@ -260,7 +260,7 @@ MaybeLocal<Function> BuiltinLoader::LookupAndCompileInternal( @@ -275,7 +275,7 @@ MaybeLocal<Function> BuiltinLoader::LookupAndCompileInternal(
const char* id, const char* id,
LocalVector<String>* parameters, LocalVector<String>* parameters,
Realm* optional_realm) { Realm* optional_realm) {
@@ -400,7 +400,7 @@ index 3377d697615ee168e49e83c4202bc227581f1aaf..1a9a57b73e635ac61016598687167a08
EscapableHandleScope scope(isolate); EscapableHandleScope scope(isolate);
Local<String> source; Local<String> source;
@@ -382,7 +382,7 @@ void BuiltinLoader::SaveCodeCache(const char* id, Local<Function> fun) { @@ -397,7 +397,7 @@ void BuiltinLoader::SaveCodeCache(const char* id, Local<Function> fun) {
MaybeLocal<Function> BuiltinLoader::LookupAndCompile(Local<Context> context, MaybeLocal<Function> BuiltinLoader::LookupAndCompile(Local<Context> context,
const char* id, const char* id,
Realm* optional_realm) { Realm* optional_realm) {
@@ -409,7 +409,7 @@ index 3377d697615ee168e49e83c4202bc227581f1aaf..1a9a57b73e635ac61016598687167a08
LocalVector<String> parameters(isolate); LocalVector<String> parameters(isolate);
// Detects parameters of the scripts based on module ids. // Detects parameters of the scripts based on module ids.
// internal/bootstrap/realm: process, getLinkedBinding, // internal/bootstrap/realm: process, getLinkedBinding,
@@ -436,7 +436,7 @@ MaybeLocal<Function> BuiltinLoader::LookupAndCompile(Local<Context> context, @@ -451,7 +451,7 @@ MaybeLocal<Function> BuiltinLoader::LookupAndCompile(Local<Context> context,
MaybeLocal<Value> BuiltinLoader::CompileAndCall(Local<Context> context, MaybeLocal<Value> BuiltinLoader::CompileAndCall(Local<Context> context,
const char* id, const char* id,
Realm* realm) { Realm* realm) {
@@ -418,7 +418,7 @@ index 3377d697615ee168e49e83c4202bc227581f1aaf..1a9a57b73e635ac61016598687167a08
// Detects parameters of the scripts based on module ids. // Detects parameters of the scripts based on module ids.
// internal/bootstrap/realm: process, getLinkedBinding, // internal/bootstrap/realm: process, getLinkedBinding,
// getInternalBinding, primordials // getInternalBinding, primordials
@@ -492,7 +492,7 @@ MaybeLocal<Value> BuiltinLoader::CompileAndCall(Local<Context> context, @@ -507,7 +507,7 @@ MaybeLocal<Value> BuiltinLoader::CompileAndCall(Local<Context> context,
if (!maybe_fn.ToLocal(&fn)) { if (!maybe_fn.ToLocal(&fn)) {
return MaybeLocal<Value>(); return MaybeLocal<Value>();
} }
@@ -427,7 +427,7 @@ index 3377d697615ee168e49e83c4202bc227581f1aaf..1a9a57b73e635ac61016598687167a08
return fn->Call(context, undefined, argc, argv); return fn->Call(context, undefined, argc, argv);
} }
@@ -530,14 +530,14 @@ bool BuiltinLoader::CompileAllBuiltinsAndCopyCodeCache( @@ -545,14 +545,14 @@ bool BuiltinLoader::CompileAllBuiltinsAndCopyCodeCache(
to_eager_compile_.emplace(id); to_eager_compile_.emplace(id);
} }
@@ -546,7 +546,7 @@ index ba6ffc2b6565dea500bc8dd4818c8fcb7648694a..e834325a763f7ea8f53210145b5edd13
InternalFieldInfo* casted_info = static_cast<InternalFieldInfo*>(info); InternalFieldInfo* casted_info = static_cast<InternalFieldInfo*>(info);
BindingData* binding = BindingData* binding =
diff --git a/src/node_messaging.cc b/src/node_messaging.cc diff --git a/src/node_messaging.cc b/src/node_messaging.cc
index 9ff675d23914aaa168de2f82b8509027de477cbf..76c934ccbc98737918c18a28e63df7eb759fed7c 100644 index 57e068ae249d618c2658638f9f3b03e1fedb6524..8c51ae4e0a435971c6d0288af87810877dd31a49 100644
--- a/src/node_messaging.cc --- a/src/node_messaging.cc
+++ b/src/node_messaging.cc +++ b/src/node_messaging.cc
@@ -254,7 +254,7 @@ namespace { @@ -254,7 +254,7 @@ namespace {
@@ -586,7 +586,7 @@ index 9ff675d23914aaa168de2f82b8509027de477cbf..76c934ccbc98737918c18a28e63df7eb
data_.Reset(); data_.Reset();
return ret; return ret;
diff --git a/src/node_modules.cc b/src/node_modules.cc diff --git a/src/node_modules.cc b/src/node_modules.cc
index ffc19850ac563082b14729e93d69695ef2c868f5..0cd351e7aff9e293e736e0aca22e67b577eb48eb 100644 index cecdda74847801fd5821bc0afdf0dfc9f131c44a..04ebecc5d924f6c2fddd9992462d1ff692e1cee5 100644
--- a/src/node_modules.cc --- a/src/node_modules.cc
+++ b/src/node_modules.cc +++ b/src/node_modules.cc
@@ -70,7 +70,7 @@ void BindingData::Deserialize(v8::Local<v8::Context> context, @@ -70,7 +70,7 @@ void BindingData::Deserialize(v8::Local<v8::Context> context,
@@ -660,10 +660,10 @@ index c2e24b4645e7903e08c80aead1c18c7bcff1bd89..e34d24d51d5c090b560d06f727043f20
// Recreate the buffer in the constructor. // Recreate the buffer in the constructor.
InternalFieldInfo* casted_info = static_cast<InternalFieldInfo*>(info); InternalFieldInfo* casted_info = static_cast<InternalFieldInfo*>(info);
diff --git a/src/node_sqlite.cc b/src/node_sqlite.cc diff --git a/src/node_sqlite.cc b/src/node_sqlite.cc
index 050d779bdcd2b3129abddc3fefa1e852831df236..3f4749286406e03e77de6567b667c0098fbc2a18 100644 index 6bfc54dd81446545ebbb0faedb55a5383b81de49..2e52fb801684feb22800d4809daab006fc7cae9c 100644
--- a/src/node_sqlite.cc --- a/src/node_sqlite.cc
+++ b/src/node_sqlite.cc +++ b/src/node_sqlite.cc
@@ -2162,7 +2162,7 @@ bool StatementSync::BindParams(const FunctionCallbackInfo<Value>& args) { @@ -2061,7 +2061,7 @@ bool StatementSync::BindParams(const FunctionCallbackInfo<Value>& args) {
if (args[0]->IsObject() && !args[0]->IsArrayBufferView()) { if (args[0]->IsObject() && !args[0]->IsArrayBufferView()) {
Local<Object> obj = args[0].As<Object>(); Local<Object> obj = args[0].As<Object>();
@@ -758,7 +758,7 @@ index 5c7d268d38ff55ce4db07463b1ea0bcb2f4e63ea..bd83654012442195866e57173b6e5d4d
static void Clear(const FunctionCallbackInfo<Value>& info) { static void Clear(const FunctionCallbackInfo<Value>& info) {
diff --git a/src/node_worker.cc b/src/node_worker.cc diff --git a/src/node_worker.cc b/src/node_worker.cc
index 1acc61af0c995ddefbc00fe232b2454de77a84a3..3041746fc8a132f68cc1d801bb1700634699828d 100644 index e7d26b4c8cbb08a175084ceac51395860dc60598..fa4ec53ee556a23c8fd018caa1eee51bc5e004fe 100644
--- a/src/node_worker.cc --- a/src/node_worker.cc
+++ b/src/node_worker.cc +++ b/src/node_worker.cc
@@ -1465,8 +1465,6 @@ void GetEnvMessagePort(const FunctionCallbackInfo<Value>& args) { @@ -1465,8 +1465,6 @@ void GetEnvMessagePort(const FunctionCallbackInfo<Value>& args) {

View File

@@ -11,10 +11,10 @@ really in 20/21. We have to wait until 22 is released to be able to
build with upstream GN files. build with upstream GN files.
diff --git a/configure.py b/configure.py diff --git a/configure.py b/configure.py
index 98a8b147e4cbfd5957c35688f2b37ae0ca52a818..fd13970ae73bbe5db186f81faed792a5597bbcd0 100755 index f31d460038db2fa2fa4c47d62be3100da959978f..209f23b04663113e4f6b3c3242c0544cfed9a950 100755
--- a/configure.py --- a/configure.py
+++ b/configure.py +++ b/configure.py
@@ -1821,7 +1821,7 @@ def configure_v8(o, configs): @@ -1736,7 +1736,7 @@ def configure_v8(o, configs):
# Until we manage to get rid of all those, v8_enable_sandbox cannot be used. # Until we manage to get rid of all those, v8_enable_sandbox cannot be used.
# Note that enabling pointer compression without enabling sandbox is unsupported by V8, # Note that enabling pointer compression without enabling sandbox is unsupported by V8,
# so this can be broken at any time. # so this can be broken at any time.
@@ -23,54 +23,8 @@ index 98a8b147e4cbfd5957c35688f2b37ae0ca52a818..fd13970ae73bbe5db186f81faed792a5
# We set v8_enable_pointer_compression_shared_cage to 0 always, even when # We set v8_enable_pointer_compression_shared_cage to 0 always, even when
# pointer compression is enabled so that we don't accidentally enable shared # pointer compression is enabled so that we don't accidentally enable shared
# cage mode when pointer compression is on. # cage mode when pointer compression is on.
diff --git a/deps/merve/BUILD.gn b/deps/merve/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..7bb318f8835dba6f4a6f211d8534bb6923958747
--- /dev/null
+++ b/deps/merve/BUILD.gn
@@ -0,0 +1,14 @@
+##############################################################################
+# #
+# DO NOT EDIT THIS FILE! #
+# #
+##############################################################################
+
+# This file is used by GN for building, which is NOT the build system used for
+# building official binaries.
+# Please modify the gyp files if you are making changes to build system.
+
+import("unofficial.gni")
+
+merve_gn_build("merve") {
+}
diff --git a/deps/merve/unofficial.gni b/deps/merve/unofficial.gni
new file mode 100644
index 0000000000000000000000000000000000000000..dfb508d1d22f84accb146620ed07d89715b367e6
--- /dev/null
+++ b/deps/merve/unofficial.gni
@@ -0,0 +1,20 @@
+# This file is used by GN for building, which is NOT the build system used for
+# building official binaries.
+# Please edit the gyp files if you are making changes to build system.
+
+# The actual configurations are put inside a template in unofficial.gni to
+# prevent accidental edits from contributors.
+template("merve_gn_build") {
+ config("merve_config") {
+ include_dirs = [ "." ]
+ }
+ gypi_values = exec_script("../../tools/gypi_to_gn.py",
+ [ rebase_path("merve.gyp") ],
+ "scope",
+ [ "merve.gyp" ])
+ source_set(target_name) {
+ forward_variables_from(invoker, "*")
+ public_configs = [ ":merve_config" ]
+ sources = gypi_values.merve_sources
+ }
+}
diff --git a/node.gni b/node.gni diff --git a/node.gni b/node.gni
index d4438f7fd61598afac2c1e3184721a759d22b10c..156fee33b3813fe4d94a1c9585f217a99dbfbd5f 100644 index d4438f7fd61598afac2c1e3184721a759d22b10c..e2407027ab05e59b2f0f1c213b98ea469db7a91b 100644
--- a/node.gni --- a/node.gni
+++ b/node.gni +++ b/node.gni
@@ -5,10 +5,10 @@ @@ -5,10 +5,10 @@
@@ -86,16 +40,7 @@ index d4438f7fd61598afac2c1e3184721a759d22b10c..156fee33b3813fe4d94a1c9585f217a9
# The location of OpenSSL - use the one from node's deps by default. # The location of OpenSSL - use the one from node's deps by default.
node_openssl_path = "$node_path/deps/openssl" node_openssl_path = "$node_path/deps/openssl"
@@ -26,8 +26,6 @@ declare_args() { @@ -50,7 +50,7 @@ declare_args() {
# TODO(zcbenz): This is currently copied from configure.py, we should share
# the list between configure.py and GN configurations.
node_builtin_shareable_builtins = [
- "deps/cjs-module-lexer/lexer.js",
- "deps/cjs-module-lexer/dist/lexer.js",
"deps/undici/undici.js",
"deps/amaro/dist/index.js",
]
@@ -50,7 +48,7 @@ declare_args() {
node_openssl_system_ca_path = "" node_openssl_system_ca_path = ""
# Initialize v8 platform during node.js startup. # Initialize v8 platform during node.js startup.
@@ -104,7 +49,7 @@ index d4438f7fd61598afac2c1e3184721a759d22b10c..156fee33b3813fe4d94a1c9585f217a9
# Custom build tag. # Custom build tag.
node_tag = "" node_tag = ""
@@ -70,10 +68,16 @@ declare_args() { @@ -70,10 +70,16 @@ declare_args() {
# TODO(zcbenz): There are few broken things for now: # TODO(zcbenz): There are few broken things for now:
# 1. cross-os compilation is not supported. # 1. cross-os compilation is not supported.
# 2. node_mksnapshot crashes when cross-compiling for x64 from arm64. # 2. node_mksnapshot crashes when cross-compiling for x64 from arm64.
@@ -123,10 +68,10 @@ index d4438f7fd61598afac2c1e3184721a759d22b10c..156fee33b3813fe4d94a1c9585f217a9
assert(!node_enable_inspector || node_use_openssl, assert(!node_enable_inspector || node_use_openssl,
diff --git a/src/node_builtins.cc b/src/node_builtins.cc diff --git a/src/node_builtins.cc b/src/node_builtins.cc
index f25ca01d6ef016489371a3a1c9d8500da65e8023..2c816bef8d64f3e0ba2993c4885641620ee64272 100644 index 7b34b14856a5193c723987f69d6040bdb6aa7c34..90fdf52d79954bf2cd86fd1d2d6da8199683d344 100644
--- a/src/node_builtins.cc --- a/src/node_builtins.cc
+++ b/src/node_builtins.cc +++ b/src/node_builtins.cc
@@ -760,6 +760,7 @@ void BuiltinLoader::RegisterExternalReferences( @@ -775,6 +775,7 @@ void BuiltinLoader::RegisterExternalReferences(
registry->Register(GetNatives); registry->Register(GetNatives);
RegisterExternalReferencesForInternalizedBuiltinCode(registry); RegisterExternalReferencesForInternalizedBuiltinCode(registry);
@@ -306,10 +251,10 @@ index 856878c33681a73d41016729dabe48b0a6a80589..91a11852d206b65485fe90fd037a0bd1
if sys.platform == 'win32': if sys.platform == 'win32':
files = [ x.replace('\\', '/') for x in files ] files = [ x.replace('\\', '/') for x in files ]
diff --git a/unofficial.gni b/unofficial.gni diff --git a/unofficial.gni b/unofficial.gni
index c742b62c484e9dd205eff63dcffad78c76828375..bff7b0650cfe8578a044e45d0f9e352859909695 100644 index c742b62c484e9dd205eff63dcffad78c76828375..20d2483bb16e297ab5b12aab6f56948d6d25cb03 100644
--- a/unofficial.gni --- a/unofficial.gni
+++ b/unofficial.gni +++ b/unofficial.gni
@@ -147,31 +147,42 @@ template("node_gn_build") { @@ -147,31 +147,41 @@ template("node_gn_build") {
public_configs = [ public_configs = [
":node_external_config", ":node_external_config",
"deps/googletest:googletest_config", "deps/googletest:googletest_config",
@@ -328,7 +273,6 @@ index c742b62c484e9dd205eff63dcffad78c76828375..bff7b0650cfe8578a044e45d0f9e3528
"deps/cares", "deps/cares",
"deps/histogram", "deps/histogram",
"deps/llhttp", "deps/llhttp",
+ "deps/merve",
"deps/nbytes", "deps/nbytes",
"deps/nghttp2", "deps/nghttp2",
- "deps/ngtcp2", - "deps/ngtcp2",
@@ -355,7 +299,7 @@ index c742b62c484e9dd205eff63dcffad78c76828375..bff7b0650cfe8578a044e45d0f9e3528
"$target_gen_dir/node_javascript.cc", "$target_gen_dir/node_javascript.cc",
] + gypi_values.node_sources ] + gypi_values.node_sources
@@ -194,7 +205,7 @@ template("node_gn_build") { @@ -194,7 +204,7 @@ template("node_gn_build") {
} }
if (node_use_openssl) { if (node_use_openssl) {
deps += [ "deps/ncrypto" ] deps += [ "deps/ncrypto" ]
@@ -364,7 +308,7 @@ index c742b62c484e9dd205eff63dcffad78c76828375..bff7b0650cfe8578a044e45d0f9e3528
sources += gypi_values.node_crypto_sources sources += gypi_values.node_crypto_sources
} }
if (node_use_sqlite) { if (node_use_sqlite) {
@@ -223,6 +234,10 @@ template("node_gn_build") { @@ -223,6 +233,10 @@ template("node_gn_build") {
} }
} }
@@ -375,7 +319,7 @@ index c742b62c484e9dd205eff63dcffad78c76828375..bff7b0650cfe8578a044e45d0f9e3528
executable(target_name) { executable(target_name) {
forward_variables_from(invoker, "*") forward_variables_from(invoker, "*")
@@ -314,6 +329,7 @@ template("node_gn_build") { @@ -314,6 +328,7 @@ template("node_gn_build") {
} }
executable("node_js2c") { executable("node_js2c") {
@@ -383,7 +327,7 @@ index c742b62c484e9dd205eff63dcffad78c76828375..bff7b0650cfe8578a044e45d0f9e3528
deps = [ deps = [
"deps/uv", "deps/uv",
"$node_simdutf_path", "$node_simdutf_path",
@@ -324,26 +340,75 @@ template("node_gn_build") { @@ -324,26 +339,75 @@ template("node_gn_build") {
"src/embedded_data.cc", "src/embedded_data.cc",
"src/embedded_data.h", "src/embedded_data.h",
] ]
@@ -469,7 +413,7 @@ index c742b62c484e9dd205eff63dcffad78c76828375..bff7b0650cfe8578a044e45d0f9e3528
outputs = [ "$target_gen_dir/node_javascript.cc" ] outputs = [ "$target_gen_dir/node_javascript.cc" ]
# Get the path to node_js2c executable of the host toolchain. # Get the path to node_js2c executable of the host toolchain.
@@ -357,11 +422,11 @@ template("node_gn_build") { @@ -357,11 +421,11 @@ template("node_gn_build") {
get_label_info(":node_js2c($host_toolchain)", "name") + get_label_info(":node_js2c($host_toolchain)", "name") +
host_executable_suffix host_executable_suffix

View File

@@ -14,10 +14,18 @@ We don't need to do this for zlib, as the existing gn workflow uses the same
Upstreamed at https://github.com/nodejs/node/pull/55903 Upstreamed at https://github.com/nodejs/node/pull/55903
diff --git a/unofficial.gni b/unofficial.gni diff --git a/unofficial.gni b/unofficial.gni
index bff7b0650cfe8578a044e45d0f9e352859909695..4ab316e45bd84e43a53335df60f847b17fe6c2fa 100644 index 20d2483bb16e297ab5b12aab6f56948d6d25cb03..253226009faf563f6db285d4b2908f308c1f96ea 100644
--- a/unofficial.gni --- a/unofficial.gni
+++ b/unofficial.gni +++ b/unofficial.gni
@@ -199,7 +199,17 @@ template("node_gn_build") { @@ -160,7 +160,6 @@ template("node_gn_build") {
":run_node_js2c",
"deps/cares",
"deps/histogram",
- "deps/llhttp",
"deps/nbytes",
"deps/nghttp2",
"deps/postject",
@@ -198,7 +197,17 @@ template("node_gn_build") {
configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
configs += [ "//build/config/gcc:symbol_visibility_default" ] configs += [ "//build/config/gcc:symbol_visibility_default" ]
} }
@@ -36,7 +44,7 @@ index bff7b0650cfe8578a044e45d0f9e352859909695..4ab316e45bd84e43a53335df60f847b1
if (v8_enable_i18n_support) { if (v8_enable_i18n_support) {
deps += [ "//third_party/icu" ] deps += [ "//third_party/icu" ]
} }
@@ -232,6 +242,19 @@ template("node_gn_build") { @@ -231,6 +240,19 @@ template("node_gn_build") {
sources += node_inspector.node_inspector_sources + sources += node_inspector.node_inspector_sources +
node_inspector.node_inspector_generated_sources node_inspector.node_inspector_generated_sources
} }

View File

@@ -33,7 +33,7 @@ index 8d7204f6cb48f783adc4d1c1eb2de0c83b7fffe2..a154559a56bf383d3c26af523c9bb07b
// Non-alphabetic chars. // Non-alphabetic chars.
diff --git a/lib/internal/http.js b/lib/internal/http.js diff --git a/lib/internal/http.js b/lib/internal/http.js
index f8b4fd7c4ca5a0907806c7e804de8c951675a36a..209e3bcf8be5a23ac528dcd673bed82cbad709ca 100644 index e664663348adc7bb31f7c9ec78481bbeb71401d9..62b659beb766b8256b214447af376f438278b058 100644
--- a/lib/internal/http.js --- a/lib/internal/http.js
+++ b/lib/internal/http.js +++ b/lib/internal/http.js
@@ -11,8 +11,8 @@ const { @@ -11,8 +11,8 @@ const {
@@ -64,10 +64,10 @@ index f8b4fd7c4ca5a0907806c7e804de8c951675a36a..209e3bcf8be5a23ac528dcd673bed82c
function ipToInt(ip) { function ipToInt(ip) {
diff --git a/node.gyp b/node.gyp diff --git a/node.gyp b/node.gyp
index f5cd416b5fe7a51084bc4af9a4427a8e62599fd8..5eb70ce3820f2b82121bc102c5182ab768cbef36 100644 index c035d1d7cdac1d18cca0ef5cefbc5ce4c1fd1b86..a48e4e5d1fb7621b12b9abeaaf78214515a23efc 100644
--- a/node.gyp --- a/node.gyp
+++ b/node.gyp +++ b/node.gyp
@@ -182,7 +182,6 @@ @@ -176,7 +176,6 @@
'src/timers.cc', 'src/timers.cc',
'src/timer_wrap.cc', 'src/timer_wrap.cc',
'src/tracing/agent.cc', 'src/tracing/agent.cc',
@@ -75,7 +75,7 @@ index f5cd416b5fe7a51084bc4af9a4427a8e62599fd8..5eb70ce3820f2b82121bc102c5182ab7
'src/tracing/node_trace_writer.cc', 'src/tracing/node_trace_writer.cc',
'src/tracing/trace_event.cc', 'src/tracing/trace_event.cc',
'src/tracing/traced_value.cc', 'src/tracing/traced_value.cc',
@@ -314,7 +313,6 @@ @@ -308,7 +307,6 @@
'src/tcp_wrap.h', 'src/tcp_wrap.h',
'src/timers.h', 'src/timers.h',
'src/tracing/agent.h', 'src/tracing/agent.h',

View File

@@ -7,7 +7,7 @@ Subject: build: ensure native module compilation fails if not using a new
This should not be upstreamed, it is a quality-of-life patch for downstream module builders. This should not be upstreamed, it is a quality-of-life patch for downstream module builders.
diff --git a/common.gypi b/common.gypi diff --git a/common.gypi b/common.gypi
index b3b5c23e471ece7584d209b3ae4197c46011d50e..bdcea65ad3e0315c85b1818e695d8b63093aed34 100644 index cf3ceaf19972ee107deff63b4dba16c12191c615..6159350823fd9f0090e2b98e8797e829fd481750 100644
--- a/common.gypi --- a/common.gypi
+++ b/common.gypi +++ b/common.gypi
@@ -89,6 +89,8 @@ @@ -89,6 +89,8 @@
@@ -42,10 +42,10 @@ index b3b5c23e471ece7584d209b3ae4197c46011d50e..bdcea65ad3e0315c85b1818e695d8b63
# list in v8/BUILD.gn. # list in v8/BUILD.gn.
['v8_enable_v8_checks == 1', { ['v8_enable_v8_checks == 1', {
diff --git a/configure.py b/configure.py diff --git a/configure.py b/configure.py
index fd13970ae73bbe5db186f81faed792a5597bbcd0..162e3b09c92b49cd39d32a87ff97a54555d3e47b 100755 index 209f23b04663113e4f6b3c3242c0544cfed9a950..88164b99ae3d37f47e5e9a9ba96d7b450d6ba4ab 100755
--- a/configure.py --- a/configure.py
+++ b/configure.py +++ b/configure.py
@@ -1802,6 +1802,7 @@ def configure_library(lib, output, pkgname=None): @@ -1717,6 +1717,7 @@ def configure_library(lib, output, pkgname=None):
def configure_v8(o, configs): def configure_v8(o, configs):
set_configuration_variable(configs, 'v8_enable_v8_checks', release=1, debug=0) set_configuration_variable(configs, 'v8_enable_v8_checks', release=1, debug=0)
@@ -54,7 +54,7 @@ index fd13970ae73bbe5db186f81faed792a5597bbcd0..162e3b09c92b49cd39d32a87ff97a545
o['variables']['v8_enable_javascript_promise_hooks'] = 1 o['variables']['v8_enable_javascript_promise_hooks'] = 1
o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0 o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0
diff --git a/src/node.h b/src/node.h diff --git a/src/node.h b/src/node.h
index ebfd7229b5f0044b628fbe0b03ac211f0c6ed9a6..b92a9d42da8419741c435643b7401efcb21a9e8b 100644 index be22ad370217a13aef2479d478a6373feaf6f208..19c34a430d095c06ccf5a988db91311d420a485a 100644
--- a/src/node.h --- a/src/node.h
+++ b/src/node.h +++ b/src/node.h
@@ -22,6 +22,12 @@ @@ -22,6 +22,12 @@

View File

@@ -10,10 +10,10 @@ JS errors and ensures embedder JS is loaded via LoadEmbedderJavaScriptSource.
That method is generated by our modifications to js2c.cc in the BUILD.gn patch That method is generated by our modifications to js2c.cc in the BUILD.gn patch
diff --git a/lib/internal/fs/watchers.js b/lib/internal/fs/watchers.js diff --git a/lib/internal/fs/watchers.js b/lib/internal/fs/watchers.js
index a493c9579669072d97c7caa9049e846bda36f8b9..334ffaa6f2d955125ca8b427ace1442c94011e18 100644 index 605dee28cace56f2366fec9d7f18894559044ae4..15dcabb3b1682438eb6d5a681363b7ea8602b9e7 100644
--- a/lib/internal/fs/watchers.js --- a/lib/internal/fs/watchers.js
+++ b/lib/internal/fs/watchers.js +++ b/lib/internal/fs/watchers.js
@@ -361,12 +361,13 @@ function emitCloseNT(self) { @@ -299,12 +299,13 @@ function emitCloseNT(self) {
} }
// Legacy alias on the C++ wrapper object. This is not public API, so we may // Legacy alias on the C++ wrapper object. This is not public API, so we may
@@ -34,7 +34,7 @@ index a493c9579669072d97c7caa9049e846bda36f8b9..334ffaa6f2d955125ca8b427ace1442c
let kResistStopPropagation; let kResistStopPropagation;
diff --git a/src/node_builtins.cc b/src/node_builtins.cc diff --git a/src/node_builtins.cc b/src/node_builtins.cc
index 2c816bef8d64f3e0ba2993c4885641620ee64272..3377d697615ee168e49e83c4202bc227581f1aaf 100644 index 90fdf52d79954bf2cd86fd1d2d6da8199683d344..703ac1be06249736073f797058d170576a0db1bf 100644
--- a/src/node_builtins.cc --- a/src/node_builtins.cc
+++ b/src/node_builtins.cc +++ b/src/node_builtins.cc
@@ -39,6 +39,7 @@ using v8::Value; @@ -39,6 +39,7 @@ using v8::Value;
@@ -42,9 +42,9 @@ index 2c816bef8d64f3e0ba2993c4885641620ee64272..3377d697615ee168e49e83c4202bc227
: config_(GetConfig()), code_cache_(std::make_shared<BuiltinCodeCache>()) { : config_(GetConfig()), code_cache_(std::make_shared<BuiltinCodeCache>()) {
LoadJavaScriptSource(); LoadJavaScriptSource();
+ LoadEmbedderJavaScriptSource(); + LoadEmbedderJavaScriptSource();
#ifdef NODE_SHARED_BUILTIN_UNDICI_UNDICI_PATH #ifdef NODE_SHARED_BUILTIN_CJS_MODULE_LEXER_LEXER_PATH
AddExternalizedBuiltin("internal/deps/undici/undici", AddExternalizedBuiltin(
STRINGIFY(NODE_SHARED_BUILTIN_UNDICI_UNDICI_PATH)); "internal/deps/cjs-module-lexer/lexer",
diff --git a/src/node_builtins.h b/src/node_builtins.h diff --git a/src/node_builtins.h b/src/node_builtins.h
index bcdd50f635757f41287c87df1db9cd3b55c4b6b9..e908f3c0e314b90ff7b6c599940ea8f4e657c709 100644 index bcdd50f635757f41287c87df1db9cd3b55c4b6b9..e908f3c0e314b90ff7b6c599940ea8f4e657c709 100644
--- a/src/node_builtins.h --- a/src/node_builtins.h

View File

@@ -11,7 +11,7 @@ node-gyp will use the result of `process.config` that reflects the environment
in which the binary got built. in which the binary got built.
diff --git a/common.gypi b/common.gypi diff --git a/common.gypi b/common.gypi
index bdcea65ad3e0315c85b1818e695d8b63093aed34..0653735a0b154e326e5df7049a7beb395f0015c8 100644 index 6159350823fd9f0090e2b98e8797e829fd481750..5f47ec9bb405f6c1574304ac68807929604cd402 100644
--- a/common.gypi --- a/common.gypi
+++ b/common.gypi +++ b/common.gypi
@@ -128,6 +128,7 @@ @@ -128,6 +128,7 @@

View File

@@ -10,7 +10,7 @@ M151, and so we should allow for building until then.
This patch can be removed at the M151 branch point. This patch can be removed at the M151 branch point.
diff --git a/common.gypi b/common.gypi diff --git a/common.gypi b/common.gypi
index 0653735a0b154e326e5df7049a7beb395f0015c8..006f52ed18d955da0d9a06e881e86e6e724095ac 100644 index 5f47ec9bb405f6c1574304ac68807929604cd402..914f28b41d05b1485874885570ae5adaabd8e1b2 100644
--- a/common.gypi --- a/common.gypi
+++ b/common.gypi +++ b/common.gypi
@@ -677,7 +677,7 @@ @@ -677,7 +677,7 @@

View File

@@ -20,7 +20,7 @@ index ab7dc27de3e304f6d912d5834da47e3b4eb25495..b6c0fd4ceee989dac55c7d54e52fef18
} }
} }
diff --git a/unofficial.gni b/unofficial.gni diff --git a/unofficial.gni b/unofficial.gni
index 4ab316e45bd84e43a53335df60f847b17fe6c2fa..def9a302830e493e51cc2b3588816fcbd3a1bb51 100644 index 253226009faf563f6db285d4b2908f308c1f96ea..dd686d2f7c8d2f6e8d6bd13a7bf2b4b140556ba9 100644
--- a/unofficial.gni --- a/unofficial.gni
+++ b/unofficial.gni +++ b/unofficial.gni
@@ -143,7 +143,10 @@ template("node_gn_build") { @@ -143,7 +143,10 @@ template("node_gn_build") {
@@ -35,7 +35,7 @@ index 4ab316e45bd84e43a53335df60f847b17fe6c2fa..def9a302830e493e51cc2b3588816fcb
public_configs = [ public_configs = [
":node_external_config", ":node_external_config",
"deps/googletest:googletest_config", "deps/googletest:googletest_config",
@@ -364,6 +367,7 @@ template("node_gn_build") { @@ -362,6 +365,7 @@ template("node_gn_build") {
"src/embedded_data.h", "src/embedded_data.h",
] ]
include_dirs = [ "src", "tools" ] include_dirs = [ "src", "tools" ]

View File

@@ -9,10 +9,10 @@ modules to sandboxed renderers.
TODO(codebytere): remove and replace with a public facing API. TODO(codebytere): remove and replace with a public facing API.
diff --git a/src/node_binding.cc b/src/node_binding.cc diff --git a/src/node_binding.cc b/src/node_binding.cc
index 740706e917b7d28c520abdbd743605bf73274f30..9ab30b3c9bc663d2947fcbfaac6f06d2c8f8a5b1 100644 index 3b284583d6ccc9b2d0273d678335b9ab0a6fa81c..fbbdc26b8d1428084709ab113f102c42424842b0 100644
--- a/src/node_binding.cc --- a/src/node_binding.cc
+++ b/src/node_binding.cc +++ b/src/node_binding.cc
@@ -656,6 +656,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) { @@ -655,6 +655,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
args.GetReturnValue().Set(exports); args.GetReturnValue().Set(exports);
} }

View File

@@ -18,10 +18,10 @@ Stage 3.
Upstreamed in https://github.com/nodejs/node/pull/60364 Upstreamed in https://github.com/nodejs/node/pull/60364
diff --git a/src/node.cc b/src/node.cc diff --git a/src/node.cc b/src/node.cc
index b9d35e60f39d1edd910cd0fc1e57157458db93f5..4421ddd05f69e32f38d074a4cc04e4e7eac89e76 100644 index ae082f2d0498e0e694e427da71078ca19086e275..f9630a5cd9bed1535a7839517313a2d47d403b1f 100644
--- a/src/node.cc --- a/src/node.cc
+++ b/src/node.cc +++ b/src/node.cc
@@ -778,7 +778,7 @@ static ExitCode ProcessGlobalArgsInternal(std::vector<std::string>* args, @@ -782,7 +782,7 @@ static ExitCode ProcessGlobalArgsInternal(std::vector<std::string>* args,
if (std::ranges::find(v8_args, "--no-js-source-phase-imports") == if (std::ranges::find(v8_args, "--no-js-source-phase-imports") ==
v8_args.end()) { v8_args.end()) {

View File

@@ -7,7 +7,7 @@ common.gypi is a file that's included in the node header bundle, despite
the fact that we do not build node with gyp. the fact that we do not build node with gyp.
diff --git a/common.gypi b/common.gypi diff --git a/common.gypi b/common.gypi
index c5a7dc9cacf8b983984e7c7de9e63d26e418cc8d..b3b5c23e471ece7584d209b3ae4197c46011d50e 100644 index 5adfd888711ae46a3ba157853359145c4409169b..cf3ceaf19972ee107deff63b4dba16c12191c615 100644
--- a/common.gypi --- a/common.gypi
+++ b/common.gypi +++ b/common.gypi
@@ -91,6 +91,23 @@ @@ -91,6 +91,23 @@

View File

@@ -78,7 +78,7 @@ index a944c18518471a55a44a7ff32190fe9920d0cb20..82214a5d051bb2ca487c92f684b03dcf
void* Data() { return data_; } void* Data() { return data_; }
diff --git a/src/node_modules.cc b/src/node_modules.cc diff --git a/src/node_modules.cc b/src/node_modules.cc
index d067b47e7e30a95740fe0275c70445707dec426b..391c57eed9058602bd8311d885cf5fc60bfea903 100644 index c5c61888ecaaeeb23ebc9887f19ae3ad4c30dbd4..e2db3f4935ad58c5b409c67bfe5fc964f4ea5e83 100644
--- a/src/node_modules.cc --- a/src/node_modules.cc
+++ b/src/node_modules.cc +++ b/src/node_modules.cc
@@ -642,7 +642,7 @@ void GetCompileCacheEntry(const FunctionCallbackInfo<Value>& args) { @@ -642,7 +642,7 @@ void GetCompileCacheEntry(const FunctionCallbackInfo<Value>& args) {

View File

@@ -9,10 +9,10 @@ conflict with Blink's in renderer and worker processes.
We should try to upstream some version of this. We should try to upstream some version of this.
diff --git a/doc/api/cli.md b/doc/api/cli.md diff --git a/doc/api/cli.md b/doc/api/cli.md
index f05686608297e538f0a6f65abb389281bced4291..c8da076f80a559b9ee6d2ffed831b088c15c8e88 100644 index d94226df8d90d791c3c5fdb7cab7357b0e2555b0..7512ec43ea10d9b0e167125040bc8136f7ad568a 100644
--- a/doc/api/cli.md --- a/doc/api/cli.md
+++ b/doc/api/cli.md +++ b/doc/api/cli.md
@@ -1820,6 +1820,14 @@ changes: @@ -1814,6 +1814,14 @@ changes:
Disable using [syntax detection][] to determine module type. Disable using [syntax detection][] to determine module type.
@@ -27,7 +27,7 @@ index f05686608297e538f0a6f65abb389281bced4291..c8da076f80a559b9ee6d2ffed831b088
### `--no-experimental-global-navigator` ### `--no-experimental-global-navigator`
<!-- YAML <!-- YAML
@@ -3499,6 +3507,7 @@ one is included in the list below. @@ -3493,6 +3501,7 @@ one is included in the list below.
* `--no-addons` * `--no-addons`
* `--no-async-context-frame` * `--no-async-context-frame`
* `--no-deprecation` * `--no-deprecation`
@@ -96,7 +96,7 @@ index f6f81f50c8bd91a72ca96093dc64c183bd58039b..aa18dab6e4171d8a7f0af4b7db1b8c2c
"experimental WebSocket API", "experimental WebSocket API",
&EnvironmentOptions::experimental_websocket, &EnvironmentOptions::experimental_websocket,
diff --git a/test/parallel/test-process-env-allowed-flags-are-documented.js b/test/parallel/test-process-env-allowed-flags-are-documented.js diff --git a/test/parallel/test-process-env-allowed-flags-are-documented.js b/test/parallel/test-process-env-allowed-flags-are-documented.js
index d62a2583523c6b3c1de394a18e8060199e446bf1..7d6c6ea7949fd6b52bb54c31a2d71257349e64a9 100644 index f09bf0940dad2068f0aa5dce783dd422773d4bbb..ccf4ffcacf9bd9965978738656b8fe091fee4d6a 100644
--- a/test/parallel/test-process-env-allowed-flags-are-documented.js --- a/test/parallel/test-process-env-allowed-flags-are-documented.js
+++ b/test/parallel/test-process-env-allowed-flags-are-documented.js +++ b/test/parallel/test-process-env-allowed-flags-are-documented.js
@@ -122,7 +122,6 @@ const undocumented = difference(process.allowedNodeEnvironmentFlags, @@ -122,7 +122,6 @@ const undocumented = difference(process.allowedNodeEnvironmentFlags,

View File

@@ -11,7 +11,7 @@ We can fix this by allowing the C++ implementation of legacyMainResolve to use
a fileExists function that does take Asar into account. a fileExists function that does take Asar into account.
diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js
index 81799fc159cf20344aac64cd7129240deb9a4fe8..12b476ff97603718186dd25b1f435d377841bd89 100644 index 8dc8bbfe8d73e2d11edc261d6fe9f37aaa81e4cd..9c965f21918b8170ca2c2d6efee067b52537698e 100644
--- a/lib/internal/modules/esm/resolve.js --- a/lib/internal/modules/esm/resolve.js
+++ b/lib/internal/modules/esm/resolve.js +++ b/lib/internal/modules/esm/resolve.js
@@ -28,14 +28,13 @@ const { BuiltinModule } = require('internal/bootstrap/realm'); @@ -28,14 +28,13 @@ const { BuiltinModule } = require('internal/bootstrap/realm');

View File

@@ -12,10 +12,10 @@ This can be removed/refactored once Node.js upgrades to a version of V8
containing the above CL. containing the above CL.
diff --git a/src/node.cc b/src/node.cc diff --git a/src/node.cc b/src/node.cc
index 0bc086ccd1ff449c0f3fb08a972a0c45d3178f1c..b9d35e60f39d1edd910cd0fc1e57157458db93f5 100644 index 8791119956ff93d65163d2ef424a8d821ebbdfad..ae082f2d0498e0e694e427da71078ca19086e275 100644
--- a/src/node.cc --- a/src/node.cc
+++ b/src/node.cc +++ b/src/node.cc
@@ -1244,7 +1244,7 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args, @@ -1248,7 +1248,7 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
result->platform_ = per_process::v8_platform.Platform(); result->platform_ = per_process::v8_platform.Platform();
} }

View File

@@ -868,10 +868,10 @@ index d21a6bd3d98d6db26cc82896e62da2869cf22842..21553911f8e16a76187bfff120dfbeea
// Make sure memory isn't released before being returned // Make sure memory isn't released before being returned
diff --git a/test/parallel/test-tls-client-auth.js b/test/parallel/test-tls-client-auth.js diff --git a/test/parallel/test-tls-client-auth.js b/test/parallel/test-tls-client-auth.js
index 04bf40b9a9e1ac6b92e98e3c4201c3e6e427d70c..495a7590be29370900659d1385afcbbb99a1fbf8 100644 index b347c0a88df571296127985f8e7b70de66726cc0..66465783d344dab1330069e36577d41fc75db962 100644
--- a/test/parallel/test-tls-client-auth.js --- a/test/parallel/test-tls-client-auth.js
+++ b/test/parallel/test-tls-client-auth.js +++ b/test/parallel/test-tls-client-auth.js
@@ -110,7 +110,7 @@ if (tls.DEFAULT_MAX_VERSION === 'TLSv1.3') connect({ @@ -112,7 +112,7 @@ if (tls.DEFAULT_MAX_VERSION === 'TLSv1.3') connect({
// and sends a fatal Alert to the client that the client discovers there has // and sends a fatal Alert to the client that the client discovers there has
// been a fatal error. // been a fatal error.
pair.client.conn.once('error', common.mustCall((err) => { pair.client.conn.once('error', common.mustCall((err) => {
@@ -879,12 +879,12 @@ index 04bf40b9a9e1ac6b92e98e3c4201c3e6e427d70c..495a7590be29370900659d1385afcbbb
+ //assert.strictEqual(err.code, 'ERR_SSL_TLSV13_ALERT_CERTIFICATE_REQUIRED'); + //assert.strictEqual(err.code, 'ERR_SSL_TLSV13_ALERT_CERTIFICATE_REQUIRED');
cleanup(); cleanup();
})); }));
})); });
diff --git a/test/parallel/test-tls-peer-certificate.js b/test/parallel/test-tls-peer-certificate.js diff --git a/test/parallel/test-tls-peer-certificate.js b/test/parallel/test-tls-peer-certificate.js
index 6c440ee44b8cf862a7bc96975ed503a1f49b33a4..212c2b0cbeeeb929a9622541ea49d9eb198188ce 100644 index 41e3c883d950e074dffcdd6df888eaf47696039c..304724b564956ff3c38cb42793141ddcc57dfd75 100644
--- a/test/parallel/test-tls-peer-certificate.js --- a/test/parallel/test-tls-peer-certificate.js
+++ b/test/parallel/test-tls-peer-certificate.js +++ b/test/parallel/test-tls-peer-certificate.js
@@ -54,7 +54,7 @@ connect({ @@ -55,7 +55,7 @@ connect({
assert.strictEqual(peerCert.ca, false); assert.strictEqual(peerCert.ca, false);
assert.strictEqual(peerCert.issuerCertificate.ca, true); assert.strictEqual(peerCert.issuerCertificate.ca, true);
assert.strictEqual(peerCert.subject.emailAddress, 'ry@tinyclouds.org'); assert.strictEqual(peerCert.subject.emailAddress, 'ry@tinyclouds.org');
@@ -893,7 +893,7 @@ index 6c440ee44b8cf862a7bc96975ed503a1f49b33a4..212c2b0cbeeeb929a9622541ea49d9eb
assert.strictEqual(peerCert.exponent, '0x10001'); assert.strictEqual(peerCert.exponent, '0x10001');
assert.strictEqual(peerCert.bits, 2048); assert.strictEqual(peerCert.bits, 2048);
// The conversion to bits is odd because modulus isn't a buffer, its a hex // The conversion to bits is odd because modulus isn't a buffer, its a hex
@@ -94,7 +94,7 @@ connect({ @@ -95,7 +95,7 @@ connect({
const issuer = peerCert.issuerCertificate; const issuer = peerCert.issuerCertificate;
assert.strictEqual(issuer.issuerCertificate, issuer); assert.strictEqual(issuer.issuerCertificate, issuer);
@@ -901,8 +901,8 @@ index 6c440ee44b8cf862a7bc96975ed503a1f49b33a4..212c2b0cbeeeb929a9622541ea49d9eb
+ assert.match(issuer.serialNumber, /4AB16C8DFD6A7D0D2DFCABDF9C4B0E92C6AD0229/i); + assert.match(issuer.serialNumber, /4AB16C8DFD6A7D0D2DFCABDF9C4B0E92C6AD0229/i);
return cleanup(); return cleanup();
})); });
@@ -112,7 +112,7 @@ connect({ @@ -114,7 +114,7 @@ connect({
assert.ok(peerCert.issuerCertificate); assert.ok(peerCert.issuerCertificate);
assert.strictEqual(peerCert.subject.emailAddress, 'ry@tinyclouds.org'); assert.strictEqual(peerCert.subject.emailAddress, 'ry@tinyclouds.org');
@@ -911,7 +911,7 @@ index 6c440ee44b8cf862a7bc96975ed503a1f49b33a4..212c2b0cbeeeb929a9622541ea49d9eb
assert.strictEqual(peerCert.exponent, undefined); assert.strictEqual(peerCert.exponent, undefined);
assert.strictEqual(peerCert.pubKey, undefined); assert.strictEqual(peerCert.pubKey, undefined);
assert.strictEqual(peerCert.modulus, undefined); assert.strictEqual(peerCert.modulus, undefined);
@@ -144,7 +144,6 @@ connect({ @@ -146,7 +146,6 @@ connect({
const issuer = peerCert.issuerCertificate; const issuer = peerCert.issuerCertificate;
assert.strictEqual(issuer.issuerCertificate, issuer); assert.strictEqual(issuer.issuerCertificate, issuer);
@@ -919,12 +919,12 @@ index 6c440ee44b8cf862a7bc96975ed503a1f49b33a4..212c2b0cbeeeb929a9622541ea49d9eb
- -
+ assert.match(issuer.serialNumber, /32E8197681DA33185867B52885F678BFDBA51727/i); + assert.match(issuer.serialNumber, /32E8197681DA33185867B52885F678BFDBA51727/i);
return cleanup(); return cleanup();
})); });
diff --git a/test/parallel/test-tls-pfx-authorizationerror.js b/test/parallel/test-tls-pfx-authorizationerror.js diff --git a/test/parallel/test-tls-pfx-authorizationerror.js b/test/parallel/test-tls-pfx-authorizationerror.js
index 53fcc0b16b5bd6f50c334fb7cc5671e31c1546b9..da428f1320e9e7bd1683724806a7438ed5aa38cc 100644 index eb705d591ef23a90bd78d52797fd1a58bc84a7dd..da428f1320e9e7bd1683724806a7438ed5aa38cc 100644
--- a/test/parallel/test-tls-pfx-authorizationerror.js --- a/test/parallel/test-tls-pfx-authorizationerror.js
+++ b/test/parallel/test-tls-pfx-authorizationerror.js +++ b/test/parallel/test-tls-pfx-authorizationerror.js
@@ -22,8 +22,8 @@ const server = tls @@ -22,13 +22,13 @@ const server = tls
rejectUnauthorized: false rejectUnauthorized: false
}, },
common.mustCall(function(c) { common.mustCall(function(c) {
@@ -935,7 +935,19 @@ index 53fcc0b16b5bd6f50c334fb7cc5671e31c1546b9..da428f1320e9e7bd1683724806a7438e
assert.strictEqual(c.authorizationError, null); assert.strictEqual(c.authorizationError, null);
c.end(); c.end();
}) })
@@ -41,8 +41,8 @@ const server = tls )
- .listen(0, function() {
+ .listen(0, common.mustCall(function() {
const client = tls.connect(
{
port: this.address().port,
@@ -36,16 +36,16 @@ const server = tls
passphrase: 'sample',
rejectUnauthorized: false
},
- function() {
+ common.mustCall(() => {
for (let i = 0; i < 10; ++i) {
// Calling this repeatedly is a regression test that verifies // Calling this repeatedly is a regression test that verifies
// that .getCertificate() does not accidentally decrease the // that .getCertificate() does not accidentally decrease the
// reference count of the X509* certificate on the native side. // reference count of the X509* certificate on the native side.
@@ -946,6 +958,11 @@ index 53fcc0b16b5bd6f50c334fb7cc5671e31c1546b9..da428f1320e9e7bd1683724806a7438e
} }
client.end(); client.end();
server.close(); server.close();
- }
+ }),
);
- });
+ }));
diff --git a/test/parallel/test-tls-set-sigalgs.js b/test/parallel/test-tls-set-sigalgs.js diff --git a/test/parallel/test-tls-set-sigalgs.js b/test/parallel/test-tls-set-sigalgs.js
index 985ca13ba2ac7d58f87c263c7654c4f4087efddf..21c199bdb12739f82a075c4e10e08faf8c587cf4 100644 index 985ca13ba2ac7d58f87c263c7654c4f4087efddf..21c199bdb12739f82a075c4e10e08faf8c587cf4 100644
--- a/test/parallel/test-tls-set-sigalgs.js --- a/test/parallel/test-tls-set-sigalgs.js
@@ -1028,7 +1045,7 @@ index bd788ec4ed88289d35798b8af8c9490a68e081a2..c6a6f33490595faabaefc9b58afdd813
for (const name of ['ML-DSA-44', 'ML-DSA-65', 'ML-DSA-87']) { for (const name of ['ML-DSA-44', 'ML-DSA-65', 'ML-DSA-87']) {
parameters.push({ parameters.push({
diff --git a/test/parallel/test-x509-escaping.js b/test/parallel/test-x509-escaping.js diff --git a/test/parallel/test-x509-escaping.js b/test/parallel/test-x509-escaping.js
index a5937a09cb1535778a6345885a69ca9bcecf3e96..336313d30b3329b73c04f2f6d6a5e02375a11a72 100644 index c8fc4abbb108a6d6849e8452d97d29187da2ebe6..825ba4c8dce775f401080a0522565bb7a087bcc3 100644
--- a/test/parallel/test-x509-escaping.js --- a/test/parallel/test-x509-escaping.js
+++ b/test/parallel/test-x509-escaping.js +++ b/test/parallel/test-x509-escaping.js
@@ -438,7 +438,7 @@ const { hasOpenSSL3 } = require('../common/crypto'); @@ -438,7 +438,7 @@ const { hasOpenSSL3 } = require('../common/crypto');

View File

@@ -6,10 +6,10 @@ Subject: fix: do not resolve electron entrypoints
This wastes fs cycles and can result in strange behavior if this path actually exists on disk This wastes fs cycles and can result in strange behavior if this path actually exists on disk
diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js
index a6fbcb6fd3c2413df96273d93b7339cad3f25f7a..130fe48b233691d8ee4c5d56f80d331924619008 100644 index e4d5579565eea07013c8260fa3c4aa3b266a4b35..fbcef937b26023e0f6f97a0e58ac7350e7616f58 100644
--- a/lib/internal/modules/esm/translators.js --- a/lib/internal/modules/esm/translators.js
+++ b/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js
@@ -392,6 +392,10 @@ function cjsPreparseModuleExports(filename, source, format) { @@ -407,6 +407,10 @@ function cjsPreparseModuleExports(filename, source, format) {
return { module, exportNames: module[kModuleExportNames] }; return { module, exportNames: module[kModuleExportNames] };
} }

View File

@@ -8,7 +8,7 @@ resource path. This commit ensures that the TraverseParent function
bails out if the parent path is outside of the resource path. bails out if the parent path is outside of the resource path.
diff --git a/src/node_modules.cc b/src/node_modules.cc diff --git a/src/node_modules.cc b/src/node_modules.cc
index 0cd351e7aff9e293e736e0aca22e67b577eb48eb..b925434940baeeb6b06882242ca947736866d175 100644 index 04ebecc5d924f6c2fddd9992462d1ff692e1cee5..5d9a9da3a068a68c13c5c0cacfe07eec3dad8bc3 100644
--- a/src/node_modules.cc --- a/src/node_modules.cc
+++ b/src/node_modules.cc +++ b/src/node_modules.cc
@@ -345,8 +345,41 @@ const BindingData::PackageConfig* BindingData::TraverseParent( @@ -345,8 +345,41 @@ const BindingData::PackageConfig* BindingData::TraverseParent(

View File

@@ -8,10 +8,10 @@ an API override to replace the native `ReadFileSync` in the `modules`
binding. binding.
diff --git a/src/env_properties.h b/src/env_properties.h diff --git a/src/env_properties.h b/src/env_properties.h
index 454750db0113d289e7f8c8cb160e91797790572c..09786f710a88e0243bfaab10d0eca5cb2db62245 100644 index bb874fec74c73b5de0ef6d1e2a872ebceefb11ce..6fafe2a8029c535fa98276e2d73f04ee603a7805 100644
--- a/src/env_properties.h --- a/src/env_properties.h
+++ b/src/env_properties.h +++ b/src/env_properties.h
@@ -492,6 +492,7 @@ @@ -491,6 +491,7 @@
V(maybe_cache_generated_source_map, v8::Function) \ V(maybe_cache_generated_source_map, v8::Function) \
V(messaging_deserialize_create_object, v8::Function) \ V(messaging_deserialize_create_object, v8::Function) \
V(message_port, v8::Object) \ V(message_port, v8::Object) \
@@ -20,7 +20,7 @@ index 454750db0113d289e7f8c8cb160e91797790572c..09786f710a88e0243bfaab10d0eca5cb
V(performance_entry_callback, v8::Function) \ V(performance_entry_callback, v8::Function) \
V(prepare_stack_trace_callback, v8::Function) \ V(prepare_stack_trace_callback, v8::Function) \
diff --git a/src/node_modules.cc b/src/node_modules.cc diff --git a/src/node_modules.cc b/src/node_modules.cc
index 3e4918a35e0d2f100f14596a3857f927b2a38c8f..ffc19850ac563082b14729e93d69695ef2c868f5 100644 index 95a7b8c32693c32ca9f57e01aff9ef06b84f78b2..cecdda74847801fd5821bc0afdf0dfc9f131c44a 100644
--- a/src/node_modules.cc --- a/src/node_modules.cc
+++ b/src/node_modules.cc +++ b/src/node_modules.cc
@@ -23,12 +23,14 @@ namespace modules { @@ -23,12 +23,14 @@ namespace modules {
@@ -118,7 +118,7 @@ index 3e4918a35e0d2f100f14596a3857f927b2a38c8f..ffc19850ac563082b14729e93d69695e
SetMethod(isolate, target, "readPackageJSON", ReadPackageJSON); SetMethod(isolate, target, "readPackageJSON", ReadPackageJSON);
SetMethod(isolate, SetMethod(isolate,
target, target,
@@ -751,6 +802,8 @@ void BindingData::CreatePerContextProperties(Local<Object> target, @@ -735,6 +786,8 @@ void BindingData::CreatePerContextProperties(Local<Object> target,
void BindingData::RegisterExternalReferences( void BindingData::RegisterExternalReferences(
ExternalReferenceRegistry* registry) { ExternalReferenceRegistry* registry) {

View File

@@ -77,10 +77,10 @@ index 22c1e9f1ae652b033903f56f394352806ddff754..961da666a233541203b5416909fd1ff0
if (cjsModule?.[kIsExecuting]) { if (cjsModule?.[kIsExecuting]) {
const parentFilename = urlToFilename(parentURL); const parentFilename = urlToFilename(parentURL);
diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js
index cc1230648881d8d14ba3902fca78291c90fb79fb..edf347102fedbb28bce221defa99c37b5834024b 100644 index c1d774b9c5c4049f7ecda4e3a1faaa59dad01764..4fd58b1cea557ec122bd860e1ebc15bd04c44f78 100644
--- a/lib/internal/modules/esm/resolve.js --- a/lib/internal/modules/esm/resolve.js
+++ b/lib/internal/modules/esm/resolve.js +++ b/lib/internal/modules/esm/resolve.js
@@ -751,6 +751,9 @@ function packageImportsResolve(name, base, conditions) { @@ -752,6 +752,9 @@ function packageImportsResolve(name, base, conditions) {
throw importNotDefined(name, packageJSONUrl, base); throw importNotDefined(name, packageJSONUrl, base);
} }
@@ -90,7 +90,7 @@ index cc1230648881d8d14ba3902fca78291c90fb79fb..edf347102fedbb28bce221defa99c37b
/** /**
* Resolves a package specifier to a URL. * Resolves a package specifier to a URL.
@@ -765,6 +768,11 @@ function packageResolve(specifier, base, conditions) { @@ -766,6 +769,11 @@ function packageResolve(specifier, base, conditions) {
return new URL('node:' + specifier); return new URL('node:' + specifier);
} }
@@ -103,10 +103,10 @@ index cc1230648881d8d14ba3902fca78291c90fb79fb..edf347102fedbb28bce221defa99c37b
const packageConfig = packageJsonReader.read(packageJSONPath, { __proto__: null, specifier, base, isESM: true }); const packageConfig = packageJsonReader.read(packageJSONPath, { __proto__: null, specifier, base, isESM: true });
diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js
index d6c96996a900da8e7d4f7f5104312e73e72c2d62..ec76d7ffa45f49721d395e8e33be79114daa0369 100644 index 1716328c7a98996a8933dbaa00a1c6c3156fb2ff..30f887663bbbd9913eff35f0e6e5b8291adda120 100644
--- a/lib/internal/modules/esm/translators.js --- a/lib/internal/modules/esm/translators.js
+++ b/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js
@@ -214,7 +214,9 @@ function createCJSModuleWrap(url, translateContext, parentURL, loadCJS = loadCJS @@ -223,7 +223,9 @@ function createCJSModuleWrap(url, translateContext, parentURL, loadCJS = loadCJS
const { exportNames, module } = cjsPreparseModuleExports(filename, source, sourceFormat); const { exportNames, module } = cjsPreparseModuleExports(filename, source, sourceFormat);
cjsCache.set(url, module); cjsCache.set(url, module);
@@ -117,7 +117,7 @@ index d6c96996a900da8e7d4f7f5104312e73e72c2d62..ec76d7ffa45f49721d395e8e33be7911
if (!exportNames.has('default')) { if (!exportNames.has('default')) {
ArrayPrototypePush(wrapperNames, 'default'); ArrayPrototypePush(wrapperNames, 'default');
} }
@@ -313,6 +315,10 @@ translators.set('require-commonjs', (url, translateContext, parentURL) => { @@ -325,6 +327,10 @@ translators.set('require-commonjs', (url, translateContext, parentURL) => {
return createCJSModuleWrap(url, translateContext, parentURL); return createCJSModuleWrap(url, translateContext, parentURL);
}); });

View File

@@ -94,7 +94,7 @@ index 175ec8ba0f2a908ffad2ce48434aeed573b09c90..3218590ddce1e92c2a9d776f20f9fb01
Cipher() = default; Cipher() = default;
Cipher(const EVP_CIPHER* cipher) : cipher_(cipher) {} Cipher(const EVP_CIPHER* cipher) : cipher_(cipher) {}
diff --git a/node.gni b/node.gni diff --git a/node.gni b/node.gni
index 156fee33b3813fe4d94a1c9585f217a99dbfbd5f..8239967653fee7791800ee3292e77b91bffaaef9 100644 index e2407027ab05e59b2f0f1c213b98ea469db7a91b..c64761b730e61edcdc0e46a48699f2fd5bb1c0a6 100644
--- a/node.gni --- a/node.gni
+++ b/node.gni +++ b/node.gni
@@ -11,7 +11,7 @@ declare_args() { @@ -11,7 +11,7 @@ declare_args() {
@@ -298,7 +298,7 @@ index 3ab33341806ad6c0b06b982a30a57b7b5399e38f..754ddf7b331465c56081db05d6fd2a45
// We declare another alias here to avoid having to include crypto_util.h // We declare another alias here to avoid having to include crypto_util.h
using EVPMDPointer = DeleteFnPtr<EVP_MD, EVP_MD_free>; using EVPMDPointer = DeleteFnPtr<EVP_MD, EVP_MD_free>;
diff --git a/src/node_metadata.h b/src/node_metadata.h diff --git a/src/node_metadata.h b/src/node_metadata.h
index 7f6268a1d83d3182b318bc95fd2ee119a2df8dea..f2ee335aa98a2465f63dafa33664197acc6f79b1 100644 index d9c533f100d25aeab1fe8589932a8ddead431258..2acab8786a8a752b17961445edeb872c2b08fdeb 100644
--- a/src/node_metadata.h --- a/src/node_metadata.h
+++ b/src/node_metadata.h +++ b/src/node_metadata.h
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@

View File

@@ -28,7 +28,7 @@ index 5f1921d15bc1d3a68c35990f85e36a0e8a5b3ec4..99c6ce57c04768d125dd0a1c6bd62bca
const result = dataURLProcessor(url); const result = dataURLProcessor(url);
if (result === 'failure') { if (result === 'failure') {
diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js
index edf347102fedbb28bce221defa99c37b5834024b..81799fc159cf20344aac64cd7129240deb9a4fe8 100644 index 4fd58b1cea557ec122bd860e1ebc15bd04c44f78..8dc8bbfe8d73e2d11edc261d6fe9f37aaa81e4cd 100644
--- a/lib/internal/modules/esm/resolve.js --- a/lib/internal/modules/esm/resolve.js
+++ b/lib/internal/modules/esm/resolve.js +++ b/lib/internal/modules/esm/resolve.js
@@ -25,7 +25,7 @@ const { @@ -25,7 +25,7 @@ const {
@@ -50,10 +50,10 @@ index edf347102fedbb28bce221defa99c37b5834024b..81799fc159cf20344aac64cd7129240d
}); });
const { search, hash } = resolved; const { search, hash } = resolved;
diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js
index ec76d7ffa45f49721d395e8e33be79114daa0369..a6fbcb6fd3c2413df96273d93b7339cad3f25f7a 100644 index 30f887663bbbd9913eff35f0e6e5b8291adda120..e4d5579565eea07013c8260fa3c4aa3b266a4b35 100644
--- a/lib/internal/modules/esm/translators.js --- a/lib/internal/modules/esm/translators.js
+++ b/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js
@@ -23,7 +23,7 @@ const { @@ -24,7 +24,7 @@ const {
const { BuiltinModule } = require('internal/bootstrap/realm'); const { BuiltinModule } = require('internal/bootstrap/realm');
const assert = require('internal/assert'); const assert = require('internal/assert');
@@ -62,7 +62,7 @@ index ec76d7ffa45f49721d395e8e33be79114daa0369..a6fbcb6fd3c2413df96273d93b7339ca
const { dirname, extname } = require('path'); const { dirname, extname } = require('path');
const { const {
assertBufferSource, assertBufferSource,
@@ -350,7 +350,7 @@ translators.set('commonjs', function commonjsStrategy(url, translateContext, par @@ -365,7 +365,7 @@ translators.set('commonjs', function commonjsStrategy(url, translateContext, par
try { try {
// We still need to read the FS to detect the exports. // We still need to read the FS to detect the exports.

View File

@@ -10,10 +10,10 @@ change, it seems to introduce an incompatibility when compiling
using clang modules. Disabling them resolves the issue. using clang modules. Disabling them resolves the issue.
diff --git a/unofficial.gni b/unofficial.gni diff --git a/unofficial.gni b/unofficial.gni
index def9a302830e493e51cc2b3588816fcbd3a1bb51..900c5e4d8a48d0725420518c923c7024518158b8 100644 index dd686d2f7c8d2f6e8d6bd13a7bf2b4b140556ba9..97e4bcfaa8aa42a5fc2b68ccdd8128eac8886532 100644
--- a/unofficial.gni --- a/unofficial.gni
+++ b/unofficial.gni +++ b/unofficial.gni
@@ -197,6 +197,10 @@ template("node_gn_build") { @@ -195,6 +195,10 @@ template("node_gn_build") {
"CoreFoundation.framework", "CoreFoundation.framework",
"Security.framework", "Security.framework",
] ]
@@ -24,7 +24,7 @@ index def9a302830e493e51cc2b3588816fcbd3a1bb51..900c5e4d8a48d0725420518c923c7024
} }
if (is_posix) { if (is_posix) {
configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
@@ -369,6 +373,12 @@ template("node_gn_build") { @@ -367,6 +371,12 @@ template("node_gn_build") {
include_dirs = [ "src", "tools" ] include_dirs = [ "src", "tools" ]
configs += [ "//build/config/compiler:no_exit_time_destructors" ] configs += [ "//build/config/compiler:no_exit_time_destructors" ]

View File

@@ -6,7 +6,7 @@ Subject: Pass all globals through "require"
(cherry picked from commit 7d015419cb7a0ecfe6728431a4ed2056cd411d62) (cherry picked from commit 7d015419cb7a0ecfe6728431a4ed2056cd411d62)
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index 0a6788d1b848d860fa3fa3e857c7feab6f16311e..a6b01d7e143fa6ffeda6fa7723e279db7678ddd4 100644 index 2b199e82fee3a9d56521b9c5cc04a20cdfd6f045..e28755a20176c2806769430910b28a0e61d7691e 100644
--- a/lib/internal/modules/cjs/loader.js --- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js
@@ -209,6 +209,13 @@ const { @@ -209,6 +209,13 @@ const {
@@ -23,7 +23,7 @@ index 0a6788d1b848d860fa3fa3e857c7feab6f16311e..a6b01d7e143fa6ffeda6fa7723e279db
const { const {
isProxy, isProxy,
} = require('internal/util/types'); } = require('internal/util/types');
@@ -1807,9 +1814,12 @@ Module.prototype._compile = function(content, filename, format) { @@ -1799,10 +1806,12 @@ Module.prototype._compile = function(content, filename, format) {
if (this[kIsMainSymbol] && getOptionValue('--inspect-brk')) { if (this[kIsMainSymbol] && getOptionValue('--inspect-brk')) {
const { callAndPauseOnStart } = internalBinding('inspector'); const { callAndPauseOnStart } = internalBinding('inspector');
result = callAndPauseOnStart(compiledWrapper, thisValue, exports, result = callAndPauseOnStart(compiledWrapper, thisValue, exports,
@@ -31,10 +31,10 @@ index 0a6788d1b848d860fa3fa3e857c7feab6f16311e..a6b01d7e143fa6ffeda6fa7723e279db
+ require, module, filename, dirname, + require, module, filename, dirname,
+ process, localGlobal, localBuffer); + process, localGlobal, localBuffer);
} else { } else {
- result = FunctionPrototypeCall(compiledWrapper, thisValue, exports, require, module, filename, dirname); result = ReflectApply(compiledWrapper, thisValue,
+ result = FunctionPrototypeCall(compiledWrapper, thisValue, exports, - [exports, require, module, filename, dirname]);
+ require, module, filename, dirname, + [exports, require, module, filename, dirname,
+ process, localGlobal, localBuffer); + process, localGlobal, localBuffer]);
} }
this[kIsExecuting] = false; this[kIsExecuting] = false;
if (requireDepth === 0) { statCache = null; } if (requireDepth === 0) { statCache = null; }

View File

@@ -18,7 +18,7 @@ This can be removed when Node.js upgrades to a version of V8 containing CLs
from the above issue. from the above issue.
diff --git a/src/api/environment.cc b/src/api/environment.cc diff --git a/src/api/environment.cc b/src/api/environment.cc
index 5f51ad205189bd75d0d9638b1104c12b537b4e9b..8974bac7dca43294cc5cc4570f8e2e78f42aefaa 100644 index 53f05293bd94e159dfedf48735989e668acdd08e..d753ad6c6b49b26b86920124f7ac90c1e052638e 100644
--- a/src/api/environment.cc --- a/src/api/environment.cc
+++ b/src/api/environment.cc +++ b/src/api/environment.cc
@@ -323,6 +323,10 @@ Isolate* NewIsolate(Isolate::CreateParams* params, @@ -323,6 +323,10 @@ Isolate* NewIsolate(Isolate::CreateParams* params,
@@ -102,7 +102,7 @@ index fdabe48dd7776c59298f7d972286d0d2ed062752..b5cf58cc953590493beb52abf249e33e
isolate, object, wrappable); isolate, object, wrappable);
} }
diff --git a/src/node.h b/src/node.h diff --git a/src/node.h b/src/node.h
index b92a9d42da8419741c435643b7401efcb21a9e8b..bbe35c7a8f1bc0bcddf628af42b71efaef8a7759 100644 index 19c34a430d095c06ccf5a988db91311d420a485a..5a6004ca4dfd15a813f3fcc7687958432e4fd5a0 100644
--- a/src/node.h --- a/src/node.h
+++ b/src/node.h +++ b/src/node.h
@@ -78,6 +78,7 @@ @@ -78,6 +78,7 @@
@@ -123,7 +123,7 @@ index b92a9d42da8419741c435643b7401efcb21a9e8b..bbe35c7a8f1bc0bcddf628af42b71efa
NODE_EXTERN v8::Isolate* NewIsolate( NODE_EXTERN v8::Isolate* NewIsolate(
std::shared_ptr<ArrayBufferAllocator> allocator, std::shared_ptr<ArrayBufferAllocator> allocator,
struct uv_loop_s* event_loop, struct uv_loop_s* event_loop,
@@ -1702,9 +1704,10 @@ void RegisterSignalHandler(int signal, @@ -1624,9 +1626,10 @@ void RegisterSignalHandler(int signal,
// work with only Node.js versions with v8::Object::Wrap() should use that // work with only Node.js versions with v8::Object::Wrap() should use that
// instead. // instead.
NODE_DEPRECATED("Use v8::Object::Wrap()", NODE_DEPRECATED("Use v8::Object::Wrap()",
@@ -138,7 +138,7 @@ index b92a9d42da8419741c435643b7401efcb21a9e8b..bbe35c7a8f1bc0bcddf628af42b71efa
} // namespace node } // namespace node
diff --git a/src/node_main_instance.cc b/src/node_main_instance.cc diff --git a/src/node_main_instance.cc b/src/node_main_instance.cc
index 6f674df3ed0dc1b4e5cd3a249fb787a9fc98361d..90f9eb84b6835c36a91ce23d77722812ce173c0f 100644 index dd6ecd1f9d82f6661b2480c0195e33515633429f..334d5cb7df7a763e0929468392dad83421cad606 100644
--- a/src/node_main_instance.cc --- a/src/node_main_instance.cc
+++ b/src/node_main_instance.cc +++ b/src/node_main_instance.cc
@@ -44,6 +44,8 @@ NodeMainInstance::NodeMainInstance(const SnapshotData* snapshot_data, @@ -44,6 +44,8 @@ NodeMainInstance::NodeMainInstance(const SnapshotData* snapshot_data,
@@ -151,7 +151,7 @@ index 6f674df3ed0dc1b4e5cd3a249fb787a9fc98361d..90f9eb84b6835c36a91ce23d77722812
isolate_ = isolate_ =
NewIsolate(isolate_params_.get(), event_loop, platform, snapshot_data); NewIsolate(isolate_params_.get(), event_loop, platform, snapshot_data);
diff --git a/src/node_worker.cc b/src/node_worker.cc diff --git a/src/node_worker.cc b/src/node_worker.cc
index fa7dc52b19119ed3d2dc407c029f56107476bc39..1acc61af0c995ddefbc00fe232b2454de77a84a3 100644 index fcfd5fecdebd2724441eb83b498b38b11eedad25..e7d26b4c8cbb08a175084ceac51395860dc60598 100644
--- a/src/node_worker.cc --- a/src/node_worker.cc
+++ b/src/node_worker.cc +++ b/src/node_worker.cc
@@ -181,6 +181,9 @@ class WorkerThreadData { @@ -181,6 +181,9 @@ class WorkerThreadData {

View File

@@ -63,7 +63,7 @@ index e66d4fcb0c064f96cdb819c783027d864fe88d12..619980b36db457ef7e476eacd446e3bf
return Intercepted::kNo; return Intercepted::kNo;
} }
diff --git a/src/node_modules.cc b/src/node_modules.cc diff --git a/src/node_modules.cc b/src/node_modules.cc
index b925434940baeeb6b06882242ca947736866d175..d067b47e7e30a95740fe0275c70445707dec426b 100644 index 5d9a9da3a068a68c13c5c0cacfe07eec3dad8bc3..c5c61888ecaaeeb23ebc9887f19ae3ad4c30dbd4 100644
--- a/src/node_modules.cc --- a/src/node_modules.cc
+++ b/src/node_modules.cc +++ b/src/node_modules.cc
@@ -682,7 +682,7 @@ static void PathHelpersLazyGetter(Local<v8::Name> name, @@ -682,7 +682,7 @@ static void PathHelpersLazyGetter(Local<v8::Name> name,

View File

@@ -121,10 +121,10 @@ index b30297eac08ad9587642b723f91d7e3b954294d4..4c5427596d1c90d3a413cdd9ff4f1151
auto backing = ArrayBuffer::NewBackingStore( auto backing = ArrayBuffer::NewBackingStore(
mem->data, mem->data,
diff --git a/src/node_buffer.cc b/src/node_buffer.cc diff --git a/src/node_buffer.cc b/src/node_buffer.cc
index e1bee00825d140232456d6dc2337420fde6bda17..04edc4ca3c0e7c2284d2822fe9f5de66ff64fda2 100644 index ddee7b7e40c3ee4054b2b15b75154607aa6431ed..decc3c8c966c2322f22d6bdd871514bb53882a29 100644
--- a/src/node_buffer.cc --- a/src/node_buffer.cc
+++ b/src/node_buffer.cc +++ b/src/node_buffer.cc
@@ -1443,7 +1443,7 @@ inline size_t CheckNumberToSize(Local<Value> number) { @@ -1420,7 +1420,7 @@ inline size_t CheckNumberToSize(Local<Value> number) {
CHECK(value >= 0 && value < maxSize); CHECK(value >= 0 && value < maxSize);
size_t size = static_cast<size_t>(value); size_t size = static_cast<size_t>(value);
#ifdef V8_ENABLE_SANDBOX #ifdef V8_ENABLE_SANDBOX
@@ -133,41 +133,6 @@ index e1bee00825d140232456d6dc2337420fde6bda17..04edc4ca3c0e7c2284d2822fe9f5de66
#endif #endif
return size; return size;
} }
@@ -1466,6 +1466,26 @@ void CreateUnsafeArrayBuffer(const FunctionCallbackInfo<Value>& args) {
env->isolate_data()->is_building_snapshot()) {
buf = ArrayBuffer::New(isolate, size);
} else {
+#if defined(V8_ENABLE_SANDBOX)
+ // When the V8 sandbox is enabled, all array buffers must be allocated
+ // within the V8 memory cage via the V8 allocator.
+ std::unique_ptr<ArrayBuffer::Allocator> allocator(
+ ArrayBuffer::Allocator::NewDefaultAllocator());
+ void* data = allocator->AllocateUninitialized(size);
+ if (!data) [[unlikely]] {
+ THROW_ERR_MEMORY_ALLOCATION_FAILED(env);
+ return;
+ }
+ std::unique_ptr<BackingStore> store = ArrayBuffer::NewBackingStore(
+ data,
+ size,
+ [](void* data, size_t length, void*) {
+ std::unique_ptr<ArrayBuffer::Allocator> allocator(
+ ArrayBuffer::Allocator::NewDefaultAllocator());
+ allocator->Free(data, length);
+ },
+ nullptr);
+#else
std::unique_ptr<BackingStore> store = ArrayBuffer::NewBackingStore(
isolate,
size,
@@ -1476,6 +1496,7 @@ void CreateUnsafeArrayBuffer(const FunctionCallbackInfo<Value>& args) {
THROW_ERR_MEMORY_ALLOCATION_FAILED(env);
return;
}
+#endif
buf = ArrayBuffer::New(isolate, std::move(store));
}
diff --git a/src/node_i18n.cc b/src/node_i18n.cc diff --git a/src/node_i18n.cc b/src/node_i18n.cc
index 3c4f419aa29470b3280174b58680b9421b0340b5..3b24ad2a2316f89d98b067e2c13988f87a9a00d2 100644 index 3c4f419aa29470b3280174b58680b9421b0340b5..3b24ad2a2316f89d98b067e2c13988f87a9a00d2 100644
--- a/src/node_i18n.cc --- a/src/node_i18n.cc

View File

@@ -12,10 +12,10 @@ See:
https://chromium-review.googlesource.com/c/v8/v8/+/6826001 https://chromium-review.googlesource.com/c/v8/v8/+/6826001
diff --git a/test/fixtures/test-runner/output/describe_it.snapshot b/test/fixtures/test-runner/output/describe_it.snapshot diff --git a/test/fixtures/test-runner/output/describe_it.snapshot b/test/fixtures/test-runner/output/describe_it.snapshot
index cae467f6487ffef4fbe94da229e30c2537fe9e95..f1240a6a99dafc18ad51d413719df58b757893ab 100644 index 67d4af7f1b9f45d48b35c930cb1490ee019d0bdf..21d8744340c5a4c002d8c91266f46c2b66591b6e 100644
--- a/test/fixtures/test-runner/output/describe_it.snapshot --- a/test/fixtures/test-runner/output/describe_it.snapshot
+++ b/test/fixtures/test-runner/output/describe_it.snapshot +++ b/test/fixtures/test-runner/output/describe_it.snapshot
@@ -726,6 +726,8 @@ not ok 60 - timeouts @@ -690,6 +690,8 @@ not ok 54 - timeouts
code: 'ERR_TEST_FAILURE' code: 'ERR_TEST_FAILURE'
stack: |- stack: |-
* *
@@ -23,8 +23,8 @@ index cae467f6487ffef4fbe94da229e30c2537fe9e95..f1240a6a99dafc18ad51d413719df58b
+ * + *
... ...
1..2 1..2
not ok 61 - successful thenable not ok 55 - successful thenable
@@ -748,6 +750,7 @@ not ok 62 - rejected thenable @@ -712,6 +714,7 @@ not ok 56 - rejected thenable
code: 'ERR_TEST_FAILURE' code: 'ERR_TEST_FAILURE'
stack: |- stack: |-
* *

View File

@@ -7,7 +7,7 @@ Instead of disabling the tests, flag them as flaky so they still run
but don't cause CI failures on flakes. but don't cause CI failures on flakes.
diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status
index 73a866bbef8b75e9f351ad9b1d3b0fd7850fca86..a052cc735a5660cb1b8b2875bb24c205ad7ecf94 100644 index 8bf4ae46f2d1d204d05adb6e951a613902f8bae2..2438ed04e3477c3bc74d02717129bf830a40c5f4 100644
--- a/test/parallel/parallel.status --- a/test/parallel/parallel.status
+++ b/test/parallel/parallel.status +++ b/test/parallel/parallel.status
@@ -5,6 +5,16 @@ prefix parallel @@ -5,6 +5,16 @@ prefix parallel

View File

@@ -0,0 +1,30 @@
#!/bin/bash
set -euo pipefail
export XDG_SESSION_TYPE=wayland
export WAYLAND_DISPLAY="${WAYLAND_DISPLAY:-wayland-99}"
if [[ -z "${XDG_RUNTIME_DIR:-}" ]]; then
XDG_RUNTIME_DIR="$(mktemp -d)"
chmod 700 "$XDG_RUNTIME_DIR"
export XDG_RUNTIME_DIR
trap 'kill "$WESTON_PID" >/dev/null 2>&1 || true; rm -rf "$XDG_RUNTIME_DIR"' EXIT
else
trap 'kill "$WESTON_PID" >/dev/null 2>&1 || true' EXIT
fi
weston \
--backend=headless-backend.so \
--socket="$WAYLAND_DISPLAY" \
--idle-time=0 \
>/tmp/weston-headless.log 2>&1 &
WESTON_PID=$!
for _ in {1..100}; do
if [[ -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]]; then
break
fi
sleep 0.1
done
node "$@" --ozone-platform=wayland

View File

@@ -99,7 +99,8 @@
"report/test-report-uv-handles", "report/test-report-uv-handles",
"report/test-report-worker", "report/test-report-worker",
"report/test-report-writereport", "report/test-report-writereport",
"sea/test-single-executable", "sea/test-single-executable-blob-config",
"sea/test-single-executable-blob-config-errors",
"sequential/test-tls-connect", "sequential/test-tls-connect",
"wpt/test-webcrypto", "wpt/test-webcrypto",
"wasm-allocation/test-wasm-allocation" "wasm-allocation/test-wasm-allocation"

View File

@@ -0,0 +1,4 @@
spec/parse-features-string-spec.ts
spec/types-spec.ts
spec/version-bump-spec.ts
spec/api-app-spec.ts

View File

@@ -14,6 +14,7 @@
#include "base/process/launch.h" #include "base/process/launch.h"
#include "base/process/process.h" #include "base/process/process.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "content/browser/network_service_instance_impl.h" // nogncheck
#include "content/public/browser/child_process_host.h" #include "content/public/browser/child_process_host.h"
#include "content/public/browser/service_process_host.h" #include "content/public/browser/service_process_host.h"
#include "content/public/common/result_codes.h" #include "content/public/common/result_codes.h"
@@ -72,7 +73,8 @@ UtilityProcessWrapper::UtilityProcessWrapper(
base::FilePath current_working_directory, base::FilePath current_working_directory,
bool use_plugin_helper, bool use_plugin_helper,
bool create_network_observer, bool create_network_observer,
bool disclaim_responsibility) { bool disclaim_responsibility)
: create_network_observer_(create_network_observer) {
#if BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_WIN)
base::win::ScopedHandle stdout_write(nullptr); base::win::ScopedHandle stdout_write(nullptr);
base::win::ScopedHandle stderr_write(nullptr); base::win::ScopedHandle stderr_write(nullptr);
@@ -212,32 +214,15 @@ UtilityProcessWrapper::UtilityProcessWrapper(
connector_->set_connection_error_handler(base::BindOnce( connector_->set_connection_error_handler(base::BindOnce(
&UtilityProcessWrapper::CloseConnectorPort, weak_factory_.GetWeakPtr())); &UtilityProcessWrapper::CloseConnectorPort, weak_factory_.GetWeakPtr()));
mojo::PendingRemote<network::mojom::URLLoaderFactory> url_loader_factory; params->url_loader_factory_params = CreateURLLoaderFactoryParams();
network::mojom::URLLoaderFactoryParamsPtr loader_params =
network::mojom::URLLoaderFactoryParams::New();
loader_params->process_id = network::OriginatingProcess::browser();
loader_params->is_orb_enabled = false;
loader_params->is_trusted = true;
if (create_network_observer) {
url_loader_network_observer_.emplace();
loader_params->url_loader_network_observer =
url_loader_network_observer_->Bind();
}
network::mojom::NetworkContext* network_context =
g_browser_process->system_network_context_manager()->GetContext();
network_context->CreateURLLoaderFactory(
url_loader_factory.InitWithNewPipeAndPassReceiver(),
std::move(loader_params));
params->url_loader_factory = std::move(url_loader_factory);
mojo::PendingRemote<network::mojom::HostResolver> host_resolver;
network_context->CreateHostResolver(
{}, host_resolver.InitWithNewPipeAndPassReceiver());
params->host_resolver = std::move(host_resolver);
params->use_network_observer_from_url_loader_factory =
create_network_observer;
node_service_remote_->Initialize(std::move(params), node_service_remote_->Initialize(std::move(params),
receiver_.BindNewPipeAndPassRemote()); receiver_.BindNewPipeAndPassRemote());
// Subscribe to Network Service process gone notifications.
network_service_gone_subscription_ =
content::RegisterNetworkServiceProcessGoneHandler(base::BindRepeating(
&UtilityProcessWrapper::CreateAndSendURLLoaderFactory,
weak_factory_.GetWeakPtr()));
} }
UtilityProcessWrapper::~UtilityProcessWrapper() { UtilityProcessWrapper::~UtilityProcessWrapper() {
@@ -429,6 +414,44 @@ void UtilityProcessWrapper::OnV8FatalError(const std::string& location,
EmitWithoutEvent("error", "FatalError", location, report); EmitWithoutEvent("error", "FatalError", location, report);
} }
void UtilityProcessWrapper::CreateAndSendURLLoaderFactory(bool /* crashed */) {
if (!node_service_remote_.is_connected())
return;
node_service_remote_->UpdateURLLoaderFactory(CreateURLLoaderFactoryParams());
}
node::mojom::URLLoaderFactoryParamsPtr
UtilityProcessWrapper::CreateURLLoaderFactoryParams() {
node::mojom::URLLoaderFactoryParamsPtr params =
node::mojom::URLLoaderFactoryParams::New();
mojo::PendingRemote<network::mojom::URLLoaderFactory> url_loader_factory;
network::mojom::URLLoaderFactoryParamsPtr loader_params =
network::mojom::URLLoaderFactoryParams::New();
loader_params->process_id = network::OriginatingProcess::browser();
loader_params->is_orb_enabled = false;
loader_params->is_trusted = true;
if (create_network_observer_) {
url_loader_network_observer_.emplace();
loader_params->url_loader_network_observer =
url_loader_network_observer_->Bind();
}
network::mojom::NetworkContext* network_context =
g_browser_process->system_network_context_manager()->GetContext();
network_context->CreateURLLoaderFactory(
url_loader_factory.InitWithNewPipeAndPassReceiver(),
std::move(loader_params));
params->url_loader_factory = std::move(url_loader_factory);
mojo::PendingRemote<network::mojom::HostResolver> host_resolver;
network_context->CreateHostResolver(
{}, host_resolver.InitWithNewPipeAndPassReceiver());
params->host_resolver = std::move(host_resolver);
params->use_network_observer_from_url_loader_factory =
create_network_observer_;
return params;
}
// static // static
raw_ptr<UtilityProcessWrapper> UtilityProcessWrapper::FromProcessId( raw_ptr<UtilityProcessWrapper> UtilityProcessWrapper::FromProcessId(
base::ProcessId pid) { base::ProcessId pid) {

View File

@@ -9,6 +9,7 @@
#include <memory> #include <memory>
#include <string> #include <string>
#include "base/callback_list.h"
#include "base/containers/id_map.h" #include "base/containers/id_map.h"
#include "base/environment.h" #include "base/environment.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
@@ -99,6 +100,11 @@ class UtilityProcessWrapper final
void OnServiceProcessDisconnected(uint32_t exit_code, void OnServiceProcessDisconnected(uint32_t exit_code,
const std::string& description); const std::string& description);
// Creates and sends a new URLLoaderFactory to the utility process.
// Called after Network Service restart to update the factory.
void CreateAndSendURLLoaderFactory(bool crashed);
node::mojom::URLLoaderFactoryParamsPtr CreateURLLoaderFactoryParams();
base::ProcessId pid_ = base::kNullProcessId; base::ProcessId pid_ = base::kNullProcessId;
#if BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_WIN)
// Non-owning handles, these will be closed when the // Non-owning handles, these will be closed when the
@@ -111,12 +117,14 @@ class UtilityProcessWrapper final
bool connector_closed_ = false; bool connector_closed_ = false;
bool terminated_ = false; bool terminated_ = false;
bool killed_ = false; bool killed_ = false;
bool create_network_observer_ = false;
std::unique_ptr<mojo::Connector> connector_; std::unique_ptr<mojo::Connector> connector_;
blink::MessagePortDescriptor host_port_; blink::MessagePortDescriptor host_port_;
mojo::Receiver<node::mojom::NodeServiceClient> receiver_{this}; mojo::Receiver<node::mojom::NodeServiceClient> receiver_{this};
mojo::Remote<node::mojom::NodeService> node_service_remote_; mojo::Remote<node::mojom::NodeService> node_service_remote_;
std::optional<electron::URLLoaderNetworkObserver> std::optional<electron::URLLoaderNetworkObserver>
url_loader_network_observer_; url_loader_network_observer_;
base::CallbackListSubscription network_service_gone_subscription_;
base::WeakPtrFactory<UtilityProcessWrapper> weak_factory_{this}; base::WeakPtrFactory<UtilityProcessWrapper> weak_factory_{this};
}; };

View File

@@ -30,6 +30,7 @@
#include "components/proxy_config/pref_proxy_config_tracker_impl.h" #include "components/proxy_config/pref_proxy_config_tracker_impl.h"
#include "components/proxy_config/proxy_config_pref_names.h" #include "components/proxy_config/proxy_config_pref_names.h"
#include "content/browser/blob_storage/chrome_blob_storage_context.h" // nogncheck #include "content/browser/blob_storage/chrome_blob_storage_context.h" // nogncheck
#include "content/browser/network_service_instance_impl.h" // nogncheck
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/cors_origin_pattern_setter.h" #include "content/public/browser/cors_origin_pattern_setter.h"
#include "content/public/browser/host_zoom_map.h" #include "content/public/browser/host_zoom_map.h"
@@ -407,10 +408,18 @@ ElectronBrowserContext::ElectronBrowserContext(
extension_system->FinishInitialization(); extension_system->FinishInitialization();
} }
#endif #endif
// Subscribe to Network Service process gone notifications to reset the
// cached URLLoaderFactory when the Network Service crashes or restarts.
network_service_gone_subscription_ =
content::RegisterNetworkServiceProcessGoneHandler(base::BindRepeating(
&ElectronBrowserContext::OnNetworkServiceProcessGone,
weak_factory_.GetWeakPtr()));
} }
ElectronBrowserContext::~ElectronBrowserContext() { ElectronBrowserContext::~ElectronBrowserContext() {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
NotifyWillBeDestroyed(); NotifyWillBeDestroyed();
// Notify any keyed services of browser context destruction. // Notify any keyed services of browser context destruction.
@@ -568,6 +577,12 @@ content::PreconnectManager* ElectronBrowserContext::GetPreconnectManager() {
return preconnect_manager_.get(); return preconnect_manager_.get();
} }
void ElectronBrowserContext::OnNetworkServiceProcessGone(bool /* crashed */) {
// Clear the cached URLLoaderFactory so the next request creates a new one
// from the new NetworkContext.
url_loader_factory_.reset();
}
scoped_refptr<network::SharedURLLoaderFactory> scoped_refptr<network::SharedURLLoaderFactory>
ElectronBrowserContext::GetURLLoaderFactory() { ElectronBrowserContext::GetURLLoaderFactory() {
if (url_loader_factory_) if (url_loader_factory_)

View File

@@ -13,7 +13,9 @@
#include <variant> #include <variant>
#include <vector> #include <vector>
#include "base/callback_list.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/memory/weak_ptr.h"
#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_context.h"
#include "content/public/browser/media_stream_request.h" #include "content/public/browser/media_stream_request.h"
#include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/bindings/remote.h"
@@ -184,6 +186,9 @@ class ElectronBrowserContext : public content::BrowserContext {
// Initialize pref registry. // Initialize pref registry.
void InitPrefs(); void InitPrefs();
// Called when the Network Service process crashes or restarts.
void OnNetworkServiceProcessGone(bool crashed);
scoped_refptr<ValueMapPrefStore> in_memory_pref_store_; scoped_refptr<ValueMapPrefStore> in_memory_pref_store_;
std::unique_ptr<CookieChangeNotifier> cookie_change_notifier_; std::unique_ptr<CookieChangeNotifier> cookie_change_notifier_;
std::unique_ptr<PrefService> prefs_; std::unique_ptr<PrefService> prefs_;
@@ -207,6 +212,9 @@ class ElectronBrowserContext : public content::BrowserContext {
// Shared URLLoaderFactory. // Shared URLLoaderFactory.
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_; scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
// Subscription to Network Service process gone notifications.
base::CallbackListSubscription network_service_gone_subscription_;
network::mojom::SSLConfigPtr ssl_config_; network::mojom::SSLConfigPtr ssl_config_;
mojo::Remote<network::mojom::SSLConfigClient> ssl_config_client_; mojo::Remote<network::mojom::SSLConfigClient> ssl_config_client_;
@@ -214,6 +222,8 @@ class ElectronBrowserContext : public content::BrowserContext {
// In-memory cache that holds objects that have been granted permissions. // In-memory cache that holds objects that have been granted permissions.
DevicePermissionMap granted_devices_; DevicePermissionMap granted_devices_;
base::WeakPtrFactory<ElectronBrowserContext> weak_factory_{this};
}; };
} // namespace electron } // namespace electron

View File

@@ -371,7 +371,7 @@ void HandleToastActivation(const std::wstring& invoked_args,
int action_index = -1; int action_index = -1;
if (!action_index_str.empty()) { if (!action_index_str.empty()) {
action_index = std::stoi(action_index_str); base::StringToInt(base::WideToUTF8(action_index_str), &action_index);
} }
std::string reply_text; std::string reply_text;

View File

@@ -5,8 +5,12 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/dcheck_is_on.h" #include "base/dcheck_is_on.h"
#include "base/logging.h" #include "base/logging.h"
#include "content/browser/network_service_instance_impl.h" // nogncheck
#include "content/public/browser/network_service_instance.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "shell/common/callback_util.h"
#include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/dictionary.h"
#include "shell/common/gin_helper/promise.h"
#include "shell/common/node_includes.h" #include "shell/common/node_includes.h"
#include "v8/include/v8.h" #include "v8/include/v8.h"
@@ -41,6 +45,18 @@ std::string GetLoggingDestination() {
return command_line->GetSwitchValueASCII(switches::kEnableLogging); return command_line->GetSwitchValueASCII(switches::kEnableLogging);
} }
v8::Local<v8::Promise> SimulateNetworkServiceCrash(v8::Isolate* isolate) {
gin_helper::Promise<void> promise(isolate);
v8::Local<v8::Promise> handle = promise.GetHandle();
auto subscription = content::RegisterNetworkServiceProcessGoneHandler(
electron::AdaptCallbackForRepeating(
base::BindOnce([](gin_helper::Promise<void> promise,
bool crashed) { promise.Resolve(); },
std::move(promise))));
content::RestartNetworkService();
return handle;
}
void Initialize(v8::Local<v8::Object> exports, void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused, v8::Local<v8::Value> unused,
v8::Local<v8::Context> context, v8::Local<v8::Context> context,
@@ -49,6 +65,7 @@ void Initialize(v8::Local<v8::Object> exports,
gin_helper::Dictionary dict{isolate, exports}; gin_helper::Dictionary dict{isolate, exports};
dict.SetMethod("log", &Log); dict.SetMethod("log", &Log);
dict.SetMethod("getLoggingDestination", &GetLoggingDestination); dict.SetMethod("getLoggingDestination", &GetLoggingDestination);
dict.SetMethod("simulateNetworkServiceCrash", &SimulateNetworkServiceCrash);
} }
} // namespace } // namespace

View File

@@ -484,6 +484,7 @@ void SimpleURLLoaderWrapper::Clone(
void SimpleURLLoaderWrapper::Cancel() { void SimpleURLLoaderWrapper::Cancel() {
loader_.reset(); loader_.reset();
url_loader_factory_.reset();
pinned_wrapper_.Reset(); pinned_wrapper_.Reset();
pinned_chunk_pipe_getter_.Reset(); pinned_chunk_pipe_getter_.Reset();
// This ensures that no further callbacks will be called, so there's no need // This ensures that no further callbacks will be called, so there's no need
@@ -750,6 +751,7 @@ void SimpleURLLoaderWrapper::OnComplete(bool success) {
// we would perform cleanup of the wrapper and we should bail out below. // we would perform cleanup of the wrapper and we should bail out below.
if (self) { if (self) {
loader_.reset(); loader_.reset();
url_loader_factory_.reset();
pinned_wrapper_.Reset(); pinned_wrapper_.Reset();
pinned_chunk_pipe_getter_.Reset(); pinned_chunk_pipe_getter_.Reset();
} }

View File

@@ -122,10 +122,9 @@ void NodeService::Initialize(
ParentPort::GetInstance()->Initialize(std::move(params->port)); ParentPort::GetInstance()->Initialize(std::move(params->port));
URLLoaderBundle::GetInstance()->SetURLLoaderFactory( if (params->url_loader_factory_params) {
std::move(params->url_loader_factory), UpdateURLLoaderFactory(std::move(params->url_loader_factory_params));
mojo::Remote(std::move(params->host_resolver)), }
params->use_network_observer_from_url_loader_factory);
js_env_ = std::make_unique<JavascriptEnvironment>(node_bindings_->uv_loop()); js_env_ = std::make_unique<JavascriptEnvironment>(node_bindings_->uv_loop());
@@ -208,4 +207,12 @@ void NodeService::Initialize(
node_bindings_->StartPolling(); node_bindings_->StartPolling();
} }
void NodeService::UpdateURLLoaderFactory(
node::mojom::URLLoaderFactoryParamsPtr params) {
URLLoaderBundle::GetInstance()->SetURLLoaderFactory(
std::move(params->url_loader_factory),
mojo::Remote(std::move(params->host_resolver)),
params->use_network_observer_from_url_loader_factory);
}
} // namespace electron } // namespace electron

View File

@@ -65,6 +65,8 @@ class NodeService : public node::mojom::NodeService {
void Initialize(node::mojom::NodeServiceParamsPtr params, void Initialize(node::mojom::NodeServiceParamsPtr params,
mojo::PendingRemote<node::mojom::NodeServiceClient> mojo::PendingRemote<node::mojom::NodeServiceClient>
client_pending_remote) override; client_pending_remote) override;
void UpdateURLLoaderFactory(
node::mojom::URLLoaderFactoryParamsPtr params) override;
private: private:
// This needs to be initialized first so that it can be destroyed last // This needs to be initialized first so that it can be destroyed last

View File

@@ -10,14 +10,18 @@ import "services/network/public/mojom/host_resolver.mojom";
import "services/network/public/mojom/url_loader_factory.mojom"; import "services/network/public/mojom/url_loader_factory.mojom";
import "third_party/blink/public/mojom/messaging/message_port_descriptor.mojom"; import "third_party/blink/public/mojom/messaging/message_port_descriptor.mojom";
struct URLLoaderFactoryParams {
pending_remote<network.mojom.URLLoaderFactory> url_loader_factory;
pending_remote<network.mojom.HostResolver> host_resolver;
bool use_network_observer_from_url_loader_factory = false;
};
struct NodeServiceParams { struct NodeServiceParams {
mojo_base.mojom.FilePath script; mojo_base.mojom.FilePath script;
array<string> args; array<string> args;
array<string> exec_args; array<string> exec_args;
blink.mojom.MessagePortDescriptor port; blink.mojom.MessagePortDescriptor port;
pending_remote<network.mojom.URLLoaderFactory> url_loader_factory; URLLoaderFactoryParams url_loader_factory_params;
pending_remote<network.mojom.HostResolver> host_resolver;
bool use_network_observer_from_url_loader_factory = false;
}; };
interface NodeServiceClient { interface NodeServiceClient {
@@ -28,4 +32,6 @@ interface NodeServiceClient {
interface NodeService { interface NodeService {
Initialize(NodeServiceParams params, Initialize(NodeServiceParams params,
pending_remote<NodeServiceClient> client_remote); pending_remote<NodeServiceClient> client_remote);
UpdateURLLoaderFactory(URLLoaderFactoryParams params);
}; };

View File

@@ -15,7 +15,7 @@ import { setTimeout } from 'node:timers/promises';
import { promisify } from 'node:util'; import { promisify } from 'node:util';
import { collectStreamBody, getResponse } from './lib/net-helpers'; import { collectStreamBody, getResponse } from './lib/net-helpers';
import { ifdescribe, ifit, listen, waitUntil } from './lib/spec-helpers'; import { ifdescribe, ifit, isWayland, listen, waitUntil } from './lib/spec-helpers';
import { closeWindow, closeAllWindows } from './lib/window-helpers'; import { closeWindow, closeAllWindows } from './lib/window-helpers';
const fixturesPath = path.resolve(__dirname, 'fixtures'); const fixturesPath = path.resolve(__dirname, 'fixtures');
@@ -587,7 +587,7 @@ describe('app module', () => {
}); });
// FIXME: re-enable this test on win32. // FIXME: re-enable this test on win32.
ifit(process.platform !== 'win32')('should emit render-process-gone event when renderer crashes', async () => { ifit(process.platform !== 'win32' && !isWayland)('should emit render-process-gone event when renderer crashes', async () => {
w = new BrowserWindow({ w = new BrowserWindow({
show: false, show: false,
webPreferences: { webPreferences: {
@@ -1437,7 +1437,7 @@ describe('app module', () => {
describe('getApplicationNameForProtocol()', () => { describe('getApplicationNameForProtocol()', () => {
// TODO: Linux CI doesn't have registered http & https handlers // TODO: Linux CI doesn't have registered http & https handlers
ifit(!(process.env.CI && process.platform === 'linux'))('returns application names for common protocols', function () { ifit(!(process.env.CI && process.platform === 'linux') && !isWayland)('returns application names for common protocols', function () {
// We can't expect particular app names here, but these protocols should // We can't expect particular app names here, but these protocols should
// at least have _something_ registered. Except on our Linux CI // at least have _something_ registered. Except on our Linux CI
// environment apparently. // environment apparently.

View File

@@ -1688,4 +1688,61 @@ describe('net module', () => {
} }
}); });
} }
describe('Network Service crash recovery', () => {
const binding = process._linkedBinding('electron_common_testing');
it('should recover net.fetch after Network Service crash (main process)', async () => {
const serverUrl = await respondOnce.toSingleURL((request, response) => {
response.end('first');
});
const firstResponse = await net.fetch(serverUrl);
expect(firstResponse.ok).to.be.true();
expect(await firstResponse.text()).to.equal('first');
await binding.simulateNetworkServiceCrash();
// Wait for StoragePartitionImpl's NetworkContext disconnect handler to
// fire and reinitialize the context in the new Network Service.
await setTimeout(500);
const secondServerUrl = await respondOnce.toSingleURL((request, response) => {
response.end('second');
});
const secondResponse = await net.fetch(secondServerUrl);
expect(secondResponse.ok).to.be.true();
expect(await secondResponse.text()).to.equal('second');
});
it('should recover net.fetch after Network Service crash (utility process)', async () => {
const child = utilityProcess.fork(path.join(fixturesPath, 'api', 'utility-process', 'network-restart-test.js'));
await once(child, 'spawn');
await once(child, 'message');
const firstServerUrl = await respondOnce.toSingleURL((request, response) => {
response.end('utility-first');
});
child.postMessage({ type: 'fetch', url: firstServerUrl });
const [firstResult] = await once(child, 'message');
expect(firstResult.ok).to.be.true();
expect(firstResult.body).to.equal('utility-first');
await binding.simulateNetworkServiceCrash();
// Needed for UpdateURLLoaderFactory IPC to propagate to the utility process
// and for any in-flight requests to settle
await setTimeout(500);
const secondServerUrl = await respondOnce.toSingleURL((request, response) => {
response.end('utility-second');
});
child.postMessage({ type: 'fetch', url: secondServerUrl });
const [secondResult] = await once(child, 'message');
expect(secondResult.ok).to.be.true();
expect(secondResult.body).to.equal('utility-second');
child.kill();
await once(child, 'exit');
});
});
}); });

View File

@@ -0,0 +1,24 @@
const { net } = require('electron');
process.parentPort.on('message', async (e) => {
const { type, url } = e.data;
if (type === 'fetch') {
try {
const response = await net.fetch(url);
const body = await response.text();
process.parentPort.postMessage({
ok: response.ok,
status: response.status,
body
});
} catch (error) {
process.parentPort.postMessage({
ok: false,
error: error.message
});
}
}
});
process.parentPort.postMessage({ type: 'ready' });

View File

@@ -25,6 +25,12 @@ const addOnly = <T>(fn: Function): T => {
export const ifit = (condition: boolean) => (condition ? it : addOnly<TestFunction>(it.skip)); export const ifit = (condition: boolean) => (condition ? it : addOnly<TestFunction>(it.skip));
export const ifdescribe = (condition: boolean) => (condition ? describe : addOnly<SuiteFunction>(describe.skip)); export const ifdescribe = (condition: boolean) => (condition ? describe : addOnly<SuiteFunction>(describe.skip));
export const isWayland = process.platform === 'linux' && (
process.env.XDG_SESSION_TYPE === 'wayland' ||
!!process.env.WAYLAND_DISPLAY ||
process.argv.includes('--ozone-platform=wayland')
);
type CleanupFunction = (() => void) | (() => Promise<void>) type CleanupFunction = (() => void) | (() => Promise<void>)
const cleanupFunctions: CleanupFunction[] = []; const cleanupFunctions: CleanupFunction[] = [];
export async function runCleanupFunctions () { export async function runCleanupFunctions () {

View File

@@ -28,7 +28,7 @@ describe('node feature', () => {
expect(msg).to.equal('message'); expect(msg).to.equal('message');
}); });
it('Has its module searth paths restricted', async () => { it('Has its module search paths restricted', async () => {
const child = childProcess.fork(path.join(fixtures, 'module', 'module-paths.js')); const child = childProcess.fork(path.join(fixtures, 'module', 'module-paths.js'));
const [msg] = await once(child, 'message'); const [msg] = await once(child, 'message');
expect(msg.length).to.equal(2); expect(msg.length).to.equal(2);