mirror of
https://github.com/electron/electron.git
synced 2026-02-26 03:01:17 -05:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dfc60f0f42 | ||
|
|
8265537daf | ||
|
|
24602a7b2a | ||
|
|
fbbcb0dfd4 | ||
|
|
7449f3f376 | ||
|
|
f3f25fd020 | ||
|
|
14ce66e4ea | ||
|
|
05f8cd8b15 | ||
|
|
f58a7be1a5 | ||
|
|
d3d2877b65 | ||
|
|
7059e38293 | ||
|
|
3a9ca3234e | ||
|
|
04c8bde38e |
11
.github/actions/build-electron/action.yml
vendored
11
.github/actions/build-electron/action.yml
vendored
@@ -63,6 +63,13 @@ runs:
|
||||
NINJA_SUMMARIZE_BUILD=1 e build
|
||||
cp out/Default/.ninja_log out/electron_ninja_log
|
||||
node electron/script/check-symlinks.js
|
||||
|
||||
# Upload build stats to Datadog
|
||||
if ! [ -z $DD_API_KEY ]; then
|
||||
npx node electron/script/build-stats.mjs out/Default/siso.INFO --upload-stats || true
|
||||
else
|
||||
echo "Skipping build-stats.mjs upload because DD_API_KEY is not set"
|
||||
fi
|
||||
- name: Build Electron dist.zip ${{ inputs.step-suffix }}
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -79,7 +86,7 @@ runs:
|
||||
shell: bash
|
||||
run: |
|
||||
cd src
|
||||
e build --target electron:electron_mksnapshot
|
||||
e build --target electron:electron_mksnapshot_zip
|
||||
ELECTRON_DEPOT_TOOLS_DISABLE_LOG=1 e d gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
|
||||
# Remove unused args from mksnapshot_args
|
||||
SEDOPTION="-i"
|
||||
@@ -89,7 +96,6 @@ runs:
|
||||
sed $SEDOPTION '/.*builtins-pgo/d' out/Default/mksnapshot_args
|
||||
sed $SEDOPTION '/--turbo-profiling-input/d' out/Default/mksnapshot_args
|
||||
|
||||
e build --target electron:electron_mksnapshot_zip
|
||||
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||
cd out/Default
|
||||
powershell Compress-Archive -update mksnapshot_args mksnapshot.zip
|
||||
@@ -123,7 +129,6 @@ runs:
|
||||
shell: bash
|
||||
run: |
|
||||
cd src
|
||||
e build --target electron:electron_chromedriver
|
||||
e build --target electron:electron_chromedriver_zip
|
||||
- name: Build Node.js headers ${{ inputs.step-suffix }}
|
||||
shell: bash
|
||||
|
||||
@@ -15,7 +15,7 @@ runs:
|
||||
git config --global core.preloadindex true
|
||||
git config --global core.longpaths true
|
||||
fi
|
||||
export BUILD_TOOLS_SHA=c13f4bdb50e65da46a4703f8f882079dd21fd99e
|
||||
export BUILD_TOOLS_SHA=706147b2376f55078f718576b28129a0457f1795
|
||||
npm i -g @electron/build-tools
|
||||
# Update depot_tools to ensure python
|
||||
e d update_depot_tools
|
||||
|
||||
@@ -66,6 +66,7 @@ concurrency:
|
||||
env:
|
||||
CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
|
||||
CHROMIUM_GIT_COOKIE_WINDOWS_STRING: ${{ secrets.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}
|
||||
DD_API_KEY: ${{ secrets.DD_API_KEY }}
|
||||
ELECTRON_ARTIFACTS_BLOB_STORAGE: ${{ secrets.ELECTRON_ARTIFACTS_BLOB_STORAGE }}
|
||||
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
|
||||
SUDOWOODO_EXCHANGE_URL: ${{ secrets.SUDOWOODO_EXCHANGE_URL }}
|
||||
@@ -84,6 +85,7 @@ jobs:
|
||||
environment: ${{ inputs.environment }}
|
||||
env:
|
||||
TARGET_ARCH: ${{ inputs.target-arch }}
|
||||
TARGET_PLATFORM: ${{ inputs.target-platform }}
|
||||
steps:
|
||||
- name: Create src dir
|
||||
run: |
|
||||
|
||||
@@ -166,22 +166,18 @@ jobs:
|
||||
path: ./src_artifacts_${{ matrix.build-type }}_${{ inputs.target-arch }}
|
||||
- name: Restore Generated Artifacts
|
||||
run: ./src/electron/script/actions/restore-artifacts.sh
|
||||
- name: Unzip Dist, Mksnapshot & Chromedriver (win)
|
||||
- name: Unzip Dist (win)
|
||||
if: ${{ inputs.target-platform == 'win' }}
|
||||
shell: powershell
|
||||
run: |
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||
cd src/out/Default
|
||||
Expand-Archive -Force dist.zip -DestinationPath ./
|
||||
Expand-Archive -Force chromedriver.zip -DestinationPath ./
|
||||
Expand-Archive -Force mksnapshot.zip -DestinationPath ./
|
||||
- name: Unzip Dist, Mksnapshot & Chromedriver (unix)
|
||||
- name: Unzip Dist (unix)
|
||||
if: ${{ inputs.target-platform != 'win' }}
|
||||
run: |
|
||||
cd src/out/Default
|
||||
unzip -:o dist.zip
|
||||
unzip -:o chromedriver.zip
|
||||
unzip -:o mksnapshot.zip
|
||||
- name: Import & Trust Self-Signed Codesigning Cert on MacOS
|
||||
if: ${{ inputs.target-platform == 'macos' && inputs.target-arch == 'x64' }}
|
||||
run: |
|
||||
|
||||
2
DEPS
2
DEPS
@@ -4,7 +4,7 @@ vars = {
|
||||
'chromium_version':
|
||||
'138.0.7204.251',
|
||||
'node_version':
|
||||
'v22.19.0',
|
||||
'v22.20.0',
|
||||
'nan_version':
|
||||
'e14bdcd1f72d62bca1d541b66da43130384ec213',
|
||||
'squirrel.mac_version':
|
||||
|
||||
@@ -137,7 +137,7 @@ by its key, which is returned from `webFrame.insertCSS(css)`.
|
||||
|
||||
Inserts `text` to the focused element.
|
||||
|
||||
### `webFrame.executeJavaScript(code[, userGesture, callback])`
|
||||
### `webFrame.executeJavaScript(code[, userGesture][, callback])`
|
||||
|
||||
* `code` string
|
||||
* `userGesture` boolean (optional) - Default is `false`.
|
||||
@@ -158,7 +158,7 @@ In the browser window some HTML APIs like `requestFullScreen` can only be
|
||||
invoked by a gesture from the user. Setting `userGesture` to `true` will remove
|
||||
this limitation.
|
||||
|
||||
### `webFrame.executeJavaScriptInIsolatedWorld(worldId, scripts[, userGesture, callback])`
|
||||
### `webFrame.executeJavaScriptInIsolatedWorld(worldId, scripts[, userGesture][, callback])`
|
||||
|
||||
* `worldId` Integer - The ID of the world to run the javascript
|
||||
in, `0` is the default main world (where content runs), `999` is the
|
||||
|
||||
@@ -199,7 +199,14 @@ BrowserWindow.prototype.setBackgroundThrottling = function (allowed: boolean) {
|
||||
};
|
||||
|
||||
BrowserWindow.prototype.addBrowserView = function (browserView: BrowserView) {
|
||||
if (browserView.ownerWindow) { browserView.ownerWindow.removeBrowserView(browserView); }
|
||||
if (this._browserViews.includes(browserView)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const ownerWindow = browserView.ownerWindow;
|
||||
if (ownerWindow && ownerWindow !== this) {
|
||||
ownerWindow.removeBrowserView(browserView);
|
||||
}
|
||||
this.contentView.addChildView(browserView.webContentsView);
|
||||
browserView.ownerWindow = this;
|
||||
browserView.webContents._setOwnerWindow(this);
|
||||
|
||||
1
patches/angle/.patches
Normal file
1
patches/angle/.patches
Normal file
@@ -0,0 +1 @@
|
||||
cherry-pick-2f564f1ca07b.patch
|
||||
125
patches/angle/cherry-pick-2f564f1ca07b.patch
Normal file
125
patches/angle/cherry-pick-2f564f1ca07b.patch
Normal file
@@ -0,0 +1,125 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Mentovai <mark@chromium.org>
|
||||
Date: Tue, 16 Sep 2025 16:46:36 -0400
|
||||
Subject: mac: handle Metal toolchain being unbundled from Xcode 26
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The Metal toolchain was formerly part of Xcode, but in Xcode 26, it has
|
||||
been unbundled and is now a separate install. Attempting to use the
|
||||
Metal toolchain without installing it results in a build error, such as:
|
||||
|
||||
error: error: cannot execute tool 'metal' due to missing Metal
|
||||
Toolchain; use: xcodebuild -downloadComponent MetalToolchain
|
||||
|
||||
By running the suggested command, the Metal toolchain can be installed,
|
||||
but the existing angle build does not know how to find it correctly.
|
||||
|
||||
For system Xcode installations, tools from the Metal toolchain (`metal`
|
||||
and `metallib`) can be run via `xcrun`. This construct should work
|
||||
equally well for older Xcode versions, for situations where it’s still
|
||||
in use.
|
||||
|
||||
For the hermetic toolchain, we’ll continue splicing the Metal toolchain
|
||||
into the location it had previously been avialable (see
|
||||
https://chromium-review.googlesource.com/c/6950738), although this is
|
||||
subject to change in the future.
|
||||
|
||||
Bug: chromium:423933062, chromium:445400016
|
||||
Change-Id: I139eca51938f7cecfec9b90fd488947160ef4ec9
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6955000
|
||||
Auto-Submit: Mark Mentovai <mark@chromium.org>
|
||||
Commit-Queue: Mark Mentovai <mark@chromium.org>
|
||||
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
||||
|
||||
diff --git a/src/libANGLE/renderer/metal/BUILD.gn b/src/libANGLE/renderer/metal/BUILD.gn
|
||||
index 96e9ee8420810f6a3ca9a0c290d4a654200eb7b9..50ac42a5b9a0f7c8b3b161af40c598cb34ff132a 100644
|
||||
--- a/src/libANGLE/renderer/metal/BUILD.gn
|
||||
+++ b/src/libANGLE/renderer/metal/BUILD.gn
|
||||
@@ -24,20 +24,56 @@ config("angle_metal_backend_config") {
|
||||
}
|
||||
|
||||
if (metal_internal_shader_compilation_supported) {
|
||||
+ template("run_metal_tool") {
|
||||
+ action(target_name) {
|
||||
+ forward_variables_from(invoker,
|
||||
+ [
|
||||
+ "deps",
|
||||
+ "sources",
|
||||
+ "outputs",
|
||||
+ "metal_tool",
|
||||
+ ])
|
||||
+ script = "shaders/metal_wrapper.py"
|
||||
+ if (use_system_xcode) {
|
||||
+ # System Xcode: run metal and metallib via xcrun. Since Xcode 26.0, the
|
||||
+ # Metal toolchain has been unbundled from Xcode, and must be installed
|
||||
+ # separately by running `xcodebuild -downloadComponent MetalToolchain`.
|
||||
+ # There is a vestigial metal executable in mac_bin_path, but it’s
|
||||
+ # incapable of running successfuly without the
|
||||
+ # rest of the Metal toolchain surrounding it. `xcrun` is able to find
|
||||
+ # and run the correct Metal toolchain when properly installed.
|
||||
+ #
|
||||
+ # If you’re using system Xcode and your build fails with this message:
|
||||
+ # error: error: cannot execute tool 'metal' due to missing Metal Toolchain; use: xcodebuild -downloadComponent MetalToolchain
|
||||
+ # then do what the error message suggests, and then retry your build.
|
||||
+ args = [
|
||||
+ "xcrun",
|
||||
+ metal_tool,
|
||||
+ ]
|
||||
+ } else {
|
||||
+ # Hermetic Xcode: at least for now, the Metal toolchain is
|
||||
+ # “spliced” into the location in the hermetic toolchain where it lived
|
||||
+ # before Xcode 26.0, so it can be run directly from there.
|
||||
+ args = [ mac_bin_path + metal_tool ]
|
||||
+ }
|
||||
+
|
||||
+ args += invoker.args
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
_metal_internal_shaders_air_file =
|
||||
"$root_gen_dir/angle/mtl_internal_shaders_autogen.air"
|
||||
|
||||
- action("angle_metal_internal_shaders_to_air") {
|
||||
- script = "shaders/metal_wrapper.py"
|
||||
-
|
||||
- outputs = [ _metal_internal_shaders_air_file ]
|
||||
-
|
||||
+ run_metal_tool("angle_metal_internal_shaders_to_air") {
|
||||
_metal_internal_shaders_metal_source =
|
||||
"shaders/mtl_internal_shaders_autogen.metal"
|
||||
sources = [ _metal_internal_shaders_metal_source ]
|
||||
|
||||
+ outputs = [ _metal_internal_shaders_air_file ]
|
||||
+
|
||||
+ metal_tool = "metal"
|
||||
+
|
||||
args = [
|
||||
- mac_bin_path + "metal",
|
||||
"-c",
|
||||
rebase_path(_metal_internal_shaders_metal_source, root_build_dir),
|
||||
"-o",
|
||||
@@ -60,17 +96,16 @@ if (metal_internal_shader_compilation_supported) {
|
||||
_metal_internal_shaders_metallib_file =
|
||||
"$root_gen_dir/angle/mtl_internal_shaders_autogen.metallib"
|
||||
|
||||
- action("angle_metal_internal_shaders_to_mtllib") {
|
||||
- script = "shaders/metal_wrapper.py"
|
||||
-
|
||||
- outputs = [ _metal_internal_shaders_metallib_file ]
|
||||
+ run_metal_tool("angle_metal_internal_shaders_to_mtllib") {
|
||||
+ deps = [ ":angle_metal_internal_shaders_to_air" ]
|
||||
|
||||
sources = [ _metal_internal_shaders_air_file ]
|
||||
|
||||
- deps = [ ":angle_metal_internal_shaders_to_air" ]
|
||||
+ outputs = [ _metal_internal_shaders_metallib_file ]
|
||||
+
|
||||
+ metal_tool = "metallib"
|
||||
|
||||
args = [
|
||||
- mac_bin_path + "metallib",
|
||||
rebase_path(_metal_internal_shaders_air_file, root_build_dir),
|
||||
"-o",
|
||||
rebase_path(_metal_internal_shaders_metallib_file, root_build_dir),
|
||||
@@ -12,5 +12,6 @@
|
||||
{ "patch_dir": "src/electron/patches/ReactiveObjC", "repo": "src/third_party/squirrel.mac/vendor/ReactiveObjC" },
|
||||
{ "patch_dir": "src/electron/patches/webrtc", "repo": "src/third_party/webrtc" },
|
||||
{ "patch_dir": "src/electron/patches/reclient-configs", "repo": "src/third_party/engflow-reclient-configs" },
|
||||
{ "patch_dir": "src/electron/patches/sqlite", "repo": "src/third_party/sqlite/src" }
|
||||
{ "patch_dir": "src/electron/patches/sqlite", "repo": "src/third_party/sqlite/src" },
|
||||
{ "patch_dir": "src/electron/patches/angle", "repo": "src/third_party/angle" }
|
||||
]
|
||||
|
||||
@@ -8,10 +8,10 @@ naturally upstream, and we will be able to remove this patch in a future
|
||||
Node.js upgrade.
|
||||
|
||||
diff --git a/src/node_platform.cc b/src/node_platform.cc
|
||||
index b438b3774d0aa7680fdbc6c6bf39a87893d221b2..ec355061825fb861c17fa2e6cc967b4c7b8d4586 100644
|
||||
index b24e170cb247261d4a16d77ad40df4dfd33709d9..5e31f984b5655ae2d1d7559b1bd550ba6dc90fb4 100644
|
||||
--- a/src/node_platform.cc
|
||||
+++ b/src/node_platform.cc
|
||||
@@ -687,8 +687,8 @@ bool NodePlatform::IdleTasksEnabled(Isolate* isolate) {
|
||||
@@ -688,8 +688,8 @@ bool NodePlatform::IdleTasksEnabled(Isolate* isolate) {
|
||||
return ForIsolate(isolate)->IdleTasksEnabled();
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
diff --git a/configure.py b/configure.py
|
||||
index 2415940835036226799a7ea14c6687cc0d56c523..0feb07afbccad97a92cee00954443407eb20ac67 100755
|
||||
index 91283ca577f580dbf1e0c4e2dbf851a9ceaa38ed..e8eaff30ec947677db2d45425f9180759d0c55de 100755
|
||||
--- a/configure.py
|
||||
+++ b/configure.py
|
||||
@@ -1722,7 +1722,7 @@ def configure_v8(o, configs):
|
||||
@@ -1728,7 +1728,7 @@ def configure_v8(o, configs):
|
||||
# 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,
|
||||
# so this can be broken at any time.
|
||||
@@ -68,7 +68,7 @@ index d4438f7fd61598afac2c1e3184721a759d22b10c..e2407027ab05e59b2f0f1c213b98ea46
|
||||
|
||||
assert(!node_enable_inspector || node_use_openssl,
|
||||
diff --git a/src/node_builtins.cc b/src/node_builtins.cc
|
||||
index b4acc40618e372b09d0cb5e3755034f08711a282..efeaaef7e4dc64a0adb5e6bdbbe18945890de62c 100644
|
||||
index b83aa87c969fb4e71cb202816713af869bb76283..c54df6fee333ddfe59b9df7e0ddd2935b4dcb33f 100644
|
||||
--- a/src/node_builtins.cc
|
||||
+++ b/src/node_builtins.cc
|
||||
@@ -789,6 +789,7 @@ void BuiltinLoader::RegisterExternalReferences(
|
||||
|
||||
@@ -10,7 +10,7 @@ V8 requires C++20 support as of https://chromium-review.googlesource.com/c/v8/v8
|
||||
This can be removed when Electron upgrades to a version of Node.js containing the required V8 version.
|
||||
|
||||
diff --git a/common.gypi b/common.gypi
|
||||
index 3a1d2fc9d147a8c89f7b5231d63d37f29979965d..6425ee9e8dba993f3e899362ce9bd7b097f08883 100644
|
||||
index c28d6f5fe2c922f0b1e3f7e56289c78e7b91c294..95c56305926fc3e0e46e4cf99ec86d3d1b5576a7 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -539,7 +539,7 @@
|
||||
@@ -22,7 +22,7 @@ index 3a1d2fc9d147a8c89f7b5231d63d37f29979965d..6425ee9e8dba993f3e899362ce9bd7b0
|
||||
],
|
||||
'defines': [ '__STDC_FORMAT_MACROS' ],
|
||||
'ldflags': [ '-rdynamic' ],
|
||||
@@ -709,7 +709,7 @@
|
||||
@@ -719,7 +719,7 @@
|
||||
['clang==1', {
|
||||
'xcode_settings': {
|
||||
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
|
||||
|
||||
@@ -64,10 +64,10 @@ index 251f51ec454f9cba4023b8b6729241ee753aac13..1de8cac6e3953ce9cab9db03530da327
|
||||
|
||||
module.exports = {
|
||||
diff --git a/node.gyp b/node.gyp
|
||||
index d604e0ddd973174aa7be6f2d250af7b9c2b0fcfd..8e97aa3f44087213425927113fe72bca9ddef45b 100644
|
||||
index 0e0071b508f605bb9b7722f8304814dc176d907e..bcb9f371c4e4d8c665058115dc39eaa65125d679 100644
|
||||
--- a/node.gyp
|
||||
+++ b/node.gyp
|
||||
@@ -176,7 +176,6 @@
|
||||
@@ -174,7 +174,6 @@
|
||||
'src/timers.cc',
|
||||
'src/timer_wrap.cc',
|
||||
'src/tracing/agent.cc',
|
||||
@@ -75,7 +75,7 @@ index d604e0ddd973174aa7be6f2d250af7b9c2b0fcfd..8e97aa3f44087213425927113fe72bca
|
||||
'src/tracing/node_trace_writer.cc',
|
||||
'src/tracing/trace_event.cc',
|
||||
'src/tracing/traced_value.cc',
|
||||
@@ -304,7 +303,6 @@
|
||||
@@ -302,7 +301,6 @@
|
||||
'src/tcp_wrap.h',
|
||||
'src/timers.h',
|
||||
'src/tracing/agent.h',
|
||||
@@ -105,7 +105,7 @@ index 40c8aea35c931c46fc62b717c978eab0659645fd..348cdfb0b42aa18f352c220cea0b896c
|
||||
if (!json_writer_)
|
||||
return;
|
||||
diff --git a/src/tracing/agent.cc b/src/tracing/agent.cc
|
||||
index 7ce59674356f9743438350949be42fa7ead2afbe..30bff4272ed8eb5146e3b73a4849c187177fc3bd 100644
|
||||
index eddcf6c3bf91b730d6ca72960e3048ceed7e7844..184e8647b2148bc597d9d3eb63f86ae99917c642 100644
|
||||
--- a/src/tracing/agent.cc
|
||||
+++ b/src/tracing/agent.cc
|
||||
@@ -2,7 +2,9 @@
|
||||
@@ -144,7 +144,7 @@ index 7ce59674356f9743438350949be42fa7ead2afbe..30bff4272ed8eb5146e3b73a4849c187
|
||||
|
||||
// This thread should be created *after* async handles are created
|
||||
// (within NodeTraceWriter and NodeTraceBuffer constructors).
|
||||
@@ -143,8 +151,10 @@ void Agent::StopTracing() {
|
||||
@@ -148,8 +156,10 @@ void Agent::StopTracing() {
|
||||
return;
|
||||
// Perform final Flush on TraceBuffer. We don't want the tracing controller
|
||||
// to flush the buffer again on destruction of the V8::Platform.
|
||||
@@ -156,7 +156,7 @@ index 7ce59674356f9743438350949be42fa7ead2afbe..30bff4272ed8eb5146e3b73a4849c187
|
||||
started_ = false;
|
||||
|
||||
// Thread should finish when the tracing loop is stopped.
|
||||
@@ -202,6 +212,7 @@ std::string Agent::GetEnabledCategories() const {
|
||||
@@ -207,6 +217,7 @@ std::string Agent::GetEnabledCategories() const {
|
||||
return categories;
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ index 7ce59674356f9743438350949be42fa7ead2afbe..30bff4272ed8eb5146e3b73a4849c187
|
||||
void Agent::AppendTraceEvent(TraceObject* trace_event) {
|
||||
for (const auto& id_writer : writers_)
|
||||
id_writer.second->AppendTraceEvent(trace_event);
|
||||
@@ -211,18 +222,21 @@ void Agent::AddMetadataEvent(std::unique_ptr<TraceObject> event) {
|
||||
@@ -216,18 +227,21 @@ void Agent::AddMetadataEvent(std::unique_ptr<TraceObject> event) {
|
||||
Mutex::ScopedLock lock(metadata_events_mutex_);
|
||||
metadata_events_.push_back(std::move(event));
|
||||
}
|
||||
@@ -187,7 +187,7 @@ index 7ce59674356f9743438350949be42fa7ead2afbe..30bff4272ed8eb5146e3b73a4849c187
|
||||
void TracingController::AddMetadataEvent(
|
||||
const unsigned char* category_group_enabled,
|
||||
const char* name,
|
||||
@@ -246,6 +260,6 @@ void TracingController::AddMetadataEvent(
|
||||
@@ -251,6 +265,6 @@ void TracingController::AddMetadataEvent(
|
||||
if (node_agent != nullptr)
|
||||
node_agent->AddMetadataEvent(std::move(trace_event));
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
diff --git a/common.gypi b/common.gypi
|
||||
index e56ba31ed068b81f5c6fbd432cd82bb6916e9a85..3a1d2fc9d147a8c89f7b5231d63d37f29979965d 100644
|
||||
index 6b79de07be3f839af5b0644f19bfef9c33de590e..c28d6f5fe2c922f0b1e3f7e56289c78e7b91c294 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -89,6 +89,8 @@
|
||||
@@ -42,10 +42,10 @@ index e56ba31ed068b81f5c6fbd432cd82bb6916e9a85..3a1d2fc9d147a8c89f7b5231d63d37f2
|
||||
# list in v8/BUILD.gn.
|
||||
['v8_enable_v8_checks == 1', {
|
||||
diff --git a/configure.py b/configure.py
|
||||
index 0feb07afbccad97a92cee00954443407eb20ac67..5eccced7cf0212f229db68c76cc824a37e4a29bc 100755
|
||||
index e8eaff30ec947677db2d45425f9180759d0c55de..dc2d9d80059e845b33444f8bdc29e82d0fe0e26b 100755
|
||||
--- a/configure.py
|
||||
+++ b/configure.py
|
||||
@@ -1704,6 +1704,7 @@ def configure_library(lib, output, pkgname=None):
|
||||
@@ -1710,6 +1710,7 @@ def configure_library(lib, output, pkgname=None):
|
||||
def configure_v8(o, configs):
|
||||
set_configuration_variable(configs, 'v8_enable_v8_checks', release=1, debug=0)
|
||||
|
||||
@@ -54,7 +54,7 @@ index 0feb07afbccad97a92cee00954443407eb20ac67..5eccced7cf0212f229db68c76cc824a3
|
||||
o['variables']['v8_enable_javascript_promise_hooks'] = 1
|
||||
o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index 835c78145956de3d8c52b6cc0581bcfef600f90b..174fd4d1af4c8cd75aec09f4548a674fd5539fb2 100644
|
||||
index a336f44dc1e785ea237865077216d41ab032c0af..96c599aa6448e2aa8e57e84f811564a5281c139a 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -22,6 +22,12 @@
|
||||
|
||||
@@ -34,7 +34,7 @@ index 0244a214b187e67e0cb89f26cd019855963ec93a..b65a3be6bcb0e28f7f43367d0fa9da53
|
||||
let kResistStopPropagation;
|
||||
|
||||
diff --git a/src/node_builtins.cc b/src/node_builtins.cc
|
||||
index efeaaef7e4dc64a0adb5e6bdbbe18945890de62c..557972987abeaa56918362638a17a9b6e0763238 100644
|
||||
index c54df6fee333ddfe59b9df7e0ddd2935b4dcb33f..4b288e0f89e0156cb5b0555c0259b2c1150770db 100644
|
||||
--- a/src/node_builtins.cc
|
||||
+++ b/src/node_builtins.cc
|
||||
@@ -35,6 +35,7 @@ using v8::Value;
|
||||
|
||||
@@ -11,7 +11,7 @@ node-gyp will use the result of `process.config` that reflects the environment
|
||||
in which the binary got built.
|
||||
|
||||
diff --git a/common.gypi b/common.gypi
|
||||
index 6425ee9e8dba993f3e899362ce9bd7b097f08883..95d66f75b582b3fd3b833109dfe110ae5b196f83 100644
|
||||
index 95c56305926fc3e0e46e4cf99ec86d3d1b5576a7..45bb2c4ff94ceac377c9117da4497cdc5ac41171 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -128,6 +128,7 @@
|
||||
|
||||
@@ -40,10 +40,10 @@ index 9b41db8b0714b7408f79cbd5b4c460d9bc08f239..35ecfb9bbaf2c8e7351e1c69da84c82a
|
||||
|
||||
/**
|
||||
diff --git a/src/module_wrap.cc b/src/module_wrap.cc
|
||||
index e317a84e55714af0a93719336d02ac26410ad724..e3880111172363feafb53b51deb08c93596cd4f4 100644
|
||||
index c52e20d742942667f43ea3e151fc6702260b176b..cbb3e7f4df72f83cb8a1afc25a7429218792e964 100644
|
||||
--- a/src/module_wrap.cc
|
||||
+++ b/src/module_wrap.cc
|
||||
@@ -895,7 +895,7 @@ MaybeLocal<Module> ModuleWrap::ResolveModuleCallback(
|
||||
@@ -901,7 +901,7 @@ MaybeLocal<Module> ModuleWrap::ResolveModuleCallback(
|
||||
return module->module_.Get(isolate);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ index e317a84e55714af0a93719336d02ac26410ad724..e3880111172363feafb53b51deb08c93
|
||||
Local<Context> context,
|
||||
Local<Data> host_defined_options,
|
||||
Local<Value> resource_name,
|
||||
@@ -967,12 +967,13 @@ void ModuleWrap::SetImportModuleDynamicallyCallback(
|
||||
@@ -973,12 +973,13 @@ void ModuleWrap::SetImportModuleDynamicallyCallback(
|
||||
Realm* realm = Realm::GetCurrent(args);
|
||||
HandleScope handle_scope(isolate);
|
||||
|
||||
@@ -68,7 +68,7 @@ index e317a84e55714af0a93719336d02ac26410ad724..e3880111172363feafb53b51deb08c93
|
||||
}
|
||||
|
||||
void ModuleWrap::HostInitializeImportMetaObjectCallback(
|
||||
@@ -1014,13 +1015,14 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback(
|
||||
@@ -1020,13 +1021,14 @@ void ModuleWrap::SetInitializeImportMetaObjectCallback(
|
||||
Realm* realm = Realm::GetCurrent(args);
|
||||
Isolate* isolate = realm->isolate();
|
||||
|
||||
|
||||
@@ -15,10 +15,10 @@ Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
|
||||
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
|
||||
|
||||
diff --git a/doc/api/cli.md b/doc/api/cli.md
|
||||
index 8cabb58e621a9951acd5551afb85c192f2b1c690..b69bacebef3e5e5e5b191c61aa5fe0f71c1edfb3 100644
|
||||
index 9a0e83b95a72486ab9751b3b8818f4beeb527041..1da7126b9d51238e9b89ee6bed602df3f5598a9e 100644
|
||||
--- a/doc/api/cli.md
|
||||
+++ b/doc/api/cli.md
|
||||
@@ -2712,39 +2712,6 @@ added: v12.0.0
|
||||
@@ -2727,39 +2727,6 @@ added: v12.0.0
|
||||
Set default [`tls.DEFAULT_MIN_VERSION`][] to 'TLSv1.3'. Use to disable support
|
||||
for TLSv1.2, which is not as secure as TLSv1.3.
|
||||
|
||||
@@ -58,7 +58,7 @@ index 8cabb58e621a9951acd5551afb85c192f2b1c690..b69bacebef3e5e5e5b191c61aa5fe0f7
|
||||
### `--trace-deprecation`
|
||||
|
||||
<!-- YAML
|
||||
@@ -3429,7 +3396,6 @@ one is included in the list below.
|
||||
@@ -3445,7 +3412,6 @@ one is included in the list below.
|
||||
* `--tls-min-v1.1`
|
||||
* `--tls-min-v1.2`
|
||||
* `--tls-min-v1.3`
|
||||
@@ -67,10 +67,10 @@ index 8cabb58e621a9951acd5551afb85c192f2b1c690..b69bacebef3e5e5e5b191c61aa5fe0f7
|
||||
* `--trace-env-js-stack`
|
||||
* `--trace-env-native-stack`
|
||||
diff --git a/doc/node.1 b/doc/node.1
|
||||
index 6913992a5476d2317a34fb69d3c6af63b686f9a6..1faef5ba1d4206a5cc4c71cb71f7a08f613fbf17 100644
|
||||
index e3b2c45af01b2e9b9522964da2572988edd2b9e9..64e975546285a1042dda6fdb54fdd502f338a929 100644
|
||||
--- a/doc/node.1
|
||||
+++ b/doc/node.1
|
||||
@@ -539,11 +539,6 @@ but the option is supported for compatibility with older Node.js versions.
|
||||
@@ -542,11 +542,6 @@ but the option is supported for compatibility with older Node.js versions.
|
||||
Set default minVersion to 'TLSv1.3'. Use to disable support for TLSv1.2 in
|
||||
favour of TLSv1.3, which is more secure.
|
||||
.
|
||||
@@ -83,7 +83,7 @@ index 6913992a5476d2317a34fb69d3c6af63b686f9a6..1faef5ba1d4206a5cc4c71cb71f7a08f
|
||||
Print stack traces for deprecations.
|
||||
.
|
||||
diff --git a/src/node.cc b/src/node.cc
|
||||
index 0d383dcdb80fe30e3c2d6880b44f626f065bb1f3..9d9992dacbc595c987827f55eb12ea8af0480df6 100644
|
||||
index f0c0b6229048a2e9bc05684fab44ab09bc34e1f6..9027df9a321f7db76edd1218c194df519017dfaf 100644
|
||||
--- a/src/node.cc
|
||||
+++ b/src/node.cc
|
||||
@@ -232,44 +232,6 @@ void Environment::WaitForInspectorFrontendByOptions() {
|
||||
@@ -150,7 +150,7 @@ index 0d383dcdb80fe30e3c2d6880b44f626f065bb1f3..9d9992dacbc595c987827f55eb12ea8a
|
||||
isolate_->SetPromiseHook(TracePromises);
|
||||
}
|
||||
diff --git a/src/node_options.cc b/src/node_options.cc
|
||||
index cfb95f65ccb0c6d150be8a4039caf26faf7cd06d..cb0ecd81b33abd7743e66e225a6cb96b4094f935 100644
|
||||
index e8424d7539db191a55edebb7d33a3c1dc37e2403..556776b79282d953fdc371d1901f21ca301bec1a 100644
|
||||
--- a/src/node_options.cc
|
||||
+++ b/src/node_options.cc
|
||||
@@ -773,10 +773,6 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
|
||||
@@ -165,10 +165,10 @@ index cfb95f65ccb0c6d150be8a4039caf26faf7cd06d..cb0ecd81b33abd7743e66e225a6cb96b
|
||||
"show stack traces on deprecations",
|
||||
&EnvironmentOptions::trace_deprecation,
|
||||
diff --git a/src/node_options.h b/src/node_options.h
|
||||
index 3ff1f4b4baa64b8ee2a4587e150ea14cb2fdfdf4..26ac54c4b18dd00b2c1f915dc1ba0e90ca70b48f 100644
|
||||
index 418dee360f867c363f1576012b32213a51c4fdd0..7078d2493ed696bc5bd92df9c629b714c1a8fbfb 100644
|
||||
--- a/src/node_options.h
|
||||
+++ b/src/node_options.h
|
||||
@@ -204,7 +204,6 @@ class EnvironmentOptions : public Options {
|
||||
@@ -205,7 +205,6 @@ class EnvironmentOptions : public Options {
|
||||
std::vector<std::string> coverage_include_pattern;
|
||||
std::vector<std::string> coverage_exclude_pattern;
|
||||
bool throw_deprecation = false;
|
||||
|
||||
@@ -18,10 +18,10 @@ Reviewed-By: Michaël Zasso <targos@protonmail.com>
|
||||
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
|
||||
|
||||
diff --git a/doc/api/cli.md b/doc/api/cli.md
|
||||
index 1a1e0ec1d89a4d0ecf1c9ae37c23b8f660c051d6..8cabb58e621a9951acd5551afb85c192f2b1c690 100644
|
||||
index b8f9fb49fcb45602828e79bd79902233b5987dda..9a0e83b95a72486ab9751b3b8818f4beeb527041 100644
|
||||
--- a/doc/api/cli.md
|
||||
+++ b/doc/api/cli.md
|
||||
@@ -3467,7 +3467,6 @@ V8 options that are allowed are:
|
||||
@@ -3483,7 +3483,6 @@ V8 options that are allowed are:
|
||||
* `--disallow-code-generation-from-strings`
|
||||
* `--enable-etw-stack-walking`
|
||||
* `--expose-gc`
|
||||
@@ -30,7 +30,7 @@ index 1a1e0ec1d89a4d0ecf1c9ae37c23b8f660c051d6..8cabb58e621a9951acd5551afb85c192
|
||||
* `--jitless`
|
||||
* `--max-old-space-size`
|
||||
diff --git a/src/node_options.cc b/src/node_options.cc
|
||||
index 415d4e34f29bc303674dccbfdc231b251401961b..cfb95f65ccb0c6d150be8a4039caf26faf7cd06d 100644
|
||||
index 8afded658c3f569de7b329ea9dddc11010748cf9..e8424d7539db191a55edebb7d33a3c1dc37e2403 100644
|
||||
--- a/src/node_options.cc
|
||||
+++ b/src/node_options.cc
|
||||
@@ -1001,11 +1001,6 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
|
||||
|
||||
@@ -8,7 +8,7 @@ to child processes spawned with `ELECTRON_RUN_AS_NODE` which is used
|
||||
by the crashpad client to connect with the handler process.
|
||||
|
||||
diff --git a/lib/child_process.js b/lib/child_process.js
|
||||
index 655349b6fa17217a9202616224032a36fd01e284..bf62c5adf0e0d75cb50636f365f71db82c29ba29 100644
|
||||
index 960ecd25ebb5b2aba0b92b869a2332a3a69011e1..ced0a5d792c63662c577a41c88b52cae076e7d08 100644
|
||||
--- a/lib/child_process.js
|
||||
+++ b/lib/child_process.js
|
||||
@@ -62,6 +62,7 @@ let debug = require('internal/util/debuglog').debuglog(
|
||||
@@ -49,8 +49,8 @@ index 655349b6fa17217a9202616224032a36fd01e284..bf62c5adf0e0d75cb50636f365f71db8
|
||||
+
|
||||
if (options.shell) {
|
||||
validateArgumentNullCheck(options.shell, 'options.shell');
|
||||
const command = ArrayPrototypeJoin([file, ...args], ' ');
|
||||
@@ -670,8 +686,6 @@ function normalizeSpawnArguments(file, args, options) {
|
||||
|
||||
@@ -671,8 +687,6 @@ function normalizeSpawnArguments(file, args, options) {
|
||||
ArrayPrototypeUnshift(args, 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.
|
||||
|
||||
diff --git a/common.gypi b/common.gypi
|
||||
index 7780ae106b479ca620a4065f08d6e4acc200628c..e56ba31ed068b81f5c6fbd432cd82bb6916e9a85 100644
|
||||
index ae31b372b96358a156761ec7e9c39c9530d1abd1..6b79de07be3f839af5b0644f19bfef9c33de590e 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -91,6 +91,23 @@
|
||||
|
||||
@@ -15,10 +15,10 @@ corresponding change.
|
||||
CL: https://chromium-review.googlesource.com/c/v8/v8/+/5300826
|
||||
|
||||
diff --git a/src/node_platform.cc b/src/node_platform.cc
|
||||
index 9c4c1e1db5fa7c0ca791e01d9be331e0957e9699..b438b3774d0aa7680fdbc6c6bf39a87893d221b2 100644
|
||||
index 0ffebd1dcb693dcddbedff5d259cf65c115f1dc2..b24e170cb247261d4a16d77ad40df4dfd33709d9 100644
|
||||
--- a/src/node_platform.cc
|
||||
+++ b/src/node_platform.cc
|
||||
@@ -307,11 +307,13 @@ void PerIsolatePlatformData::FlushTasks(uv_async_t* handle) {
|
||||
@@ -308,11 +308,13 @@ void PerIsolatePlatformData::FlushTasks(uv_async_t* handle) {
|
||||
platform_data->FlushForegroundTasksInternal();
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ index 9c4c1e1db5fa7c0ca791e01d9be331e0957e9699..b438b3774d0aa7680fdbc6c6bf39a878
|
||||
// The task can be posted from any V8 background worker thread, even when
|
||||
// the foreground task runner is being cleaned up by Shutdown(). In that
|
||||
// case, make sure we wait until the shutdown is completed (which leads
|
||||
@@ -330,8 +332,10 @@ void PerIsolatePlatformData::PostTask(std::unique_ptr<Task> task) {
|
||||
@@ -331,8 +333,10 @@ void PerIsolatePlatformData::PostTask(std::unique_ptr<Task> task) {
|
||||
uv_async_send(flush_tasks_);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ index 9c4c1e1db5fa7c0ca791e01d9be331e0957e9699..b438b3774d0aa7680fdbc6c6bf39a878
|
||||
if (debug_log_level_ != PlatformDebugLogLevel::kNone) {
|
||||
fprintf(stderr,
|
||||
"\nPerIsolatePlatformData::PostDelayedTaskImpl %p %f",
|
||||
@@ -353,13 +357,15 @@ void PerIsolatePlatformData::PostDelayedTask(
|
||||
@@ -354,13 +358,15 @@ void PerIsolatePlatformData::PostDelayedTask(
|
||||
uv_async_send(flush_tasks_);
|
||||
}
|
||||
|
||||
|
||||
@@ -53,10 +53,10 @@ index e3afd30ba1f591d0298793bc42fd7166a4219bce..408dc96307d7f52f92db41004b358051
|
||||
const maybeMain = resolvedOption <= legacyMainResolveExtensionsIndexes.kResolvedByMainIndexNode ?
|
||||
packageConfig.main || './' : '';
|
||||
diff --git a/src/node_file.cc b/src/node_file.cc
|
||||
index c8e7e341b1d9f5a1142afdc265704455c252a0c3..7221708a2296ff44c19ed01dc52d78653ecc4e58 100644
|
||||
index e78326ed0de805a8bf4f621cad9158635eb44aa2..d7009937b31729f33d9c45cbda7f5440fbdac2aa 100644
|
||||
--- a/src/node_file.cc
|
||||
+++ b/src/node_file.cc
|
||||
@@ -3504,13 +3504,25 @@ static void CpSyncCopyDir(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -3502,13 +3502,25 @@ static void CpSyncCopyDir(const FunctionCallbackInfo<Value>& args) {
|
||||
}
|
||||
|
||||
BindingData::FilePathIsFileReturnType BindingData::FilePathIsFile(
|
||||
@@ -83,7 +83,7 @@ index c8e7e341b1d9f5a1142afdc265704455c252a0c3..7221708a2296ff44c19ed01dc52d7865
|
||||
uv_fs_t req;
|
||||
|
||||
int rc = uv_fs_stat(env->event_loop(), &req, file_path.c_str(), nullptr);
|
||||
@@ -3568,6 +3580,11 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -3566,6 +3578,11 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
|
||||
std::optional<std::string> initial_file_path;
|
||||
std::string file_path;
|
||||
|
||||
@@ -95,7 +95,7 @@ index c8e7e341b1d9f5a1142afdc265704455c252a0c3..7221708a2296ff44c19ed01dc52d7865
|
||||
if (args.Length() >= 2 && args[1]->IsString()) {
|
||||
auto package_config_main = Utf8Value(isolate, args[1]).ToString();
|
||||
|
||||
@@ -3588,7 +3605,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -3586,7 +3603,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
|
||||
BufferValue buff_file_path(isolate, local_file_path);
|
||||
ToNamespacedPath(env, &buff_file_path);
|
||||
|
||||
@@ -104,7 +104,7 @@ index c8e7e341b1d9f5a1142afdc265704455c252a0c3..7221708a2296ff44c19ed01dc52d7865
|
||||
case BindingData::FilePathIsFileReturnType::kIsFile:
|
||||
return args.GetReturnValue().Set(i);
|
||||
case BindingData::FilePathIsFileReturnType::kIsNotFile:
|
||||
@@ -3625,7 +3642,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -3623,7 +3640,7 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
|
||||
BufferValue buff_file_path(isolate, local_file_path);
|
||||
ToNamespacedPath(env, &buff_file_path);
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ index 13e41d67c635c27bd5e69eb4960eace34beaef0d..9a99c9ca93907630f9f3ba7ba24577a1
|
||||
let filename = call.getFileName();
|
||||
const line = call.getLineNumber() - 1;
|
||||
diff --git a/src/node_options.cc b/src/node_options.cc
|
||||
index 653112fbaea59fe8b446236085dcae8be671c6e5..415d4e34f29bc303674dccbfdc231b251401961b 100644
|
||||
index e3509abbc3bf84ac0edcd495eb3dde6219dbfc2d..8afded658c3f569de7b329ea9dddc11010748cf9 100644
|
||||
--- a/src/node_options.cc
|
||||
+++ b/src/node_options.cc
|
||||
@@ -1566,14 +1566,16 @@ void GetEmbedderOptions(const FunctionCallbackInfo<Value>& args) {
|
||||
|
||||
@@ -12,10 +12,10 @@ This can be removed/refactored once Node.js upgrades to a version of V8
|
||||
containing the above CL.
|
||||
|
||||
diff --git a/src/node.cc b/src/node.cc
|
||||
index 9d9992dacbc595c987827f55eb12ea8af0480df6..d43a88b8780f04d186485a2dc58ad07083e699ac 100644
|
||||
index 9027df9a321f7db76edd1218c194df519017dfaf..cc1c35da5601fffc3c53985c5d95cc466662649d 100644
|
||||
--- a/src/node.cc
|
||||
+++ b/src/node.cc
|
||||
@@ -1222,7 +1222,7 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
|
||||
@@ -1246,7 +1246,7 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
|
||||
result->platform_ = per_process::v8_platform.Platform();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,19 +6,20 @@ Subject: fix: do not resolve electron entrypoints
|
||||
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
|
||||
index 8e099e0961b624c6143f5a60f050855b3366f177..dfed827fd3fc794f52bad39ccf7b5c14b1caebc3 100644
|
||||
index 2c33fd44b9a251682de78a8bcdad9ee5a0d3e5e8..ae3ef0e853ae19fca649704854d4bda84a5bd287 100644
|
||||
--- a/lib/internal/modules/esm/translators.js
|
||||
+++ b/lib/internal/modules/esm/translators.js
|
||||
@@ -293,6 +293,9 @@ function cjsPreparseModuleExports(filename, source, isMain, format) {
|
||||
if (module && module[kModuleExportNames] !== undefined) {
|
||||
@@ -355,6 +355,10 @@ function cjsPreparseModuleExports(filename, source, format) {
|
||||
return { module, exportNames: module[kModuleExportNames] };
|
||||
}
|
||||
|
||||
+ if (filename === 'electron') {
|
||||
+ return { module, exportNames: new SafeSet(['default', ...Object.keys(module.exports)]) };
|
||||
+ }
|
||||
const loaded = Boolean(module);
|
||||
if (!loaded) {
|
||||
module = new CJSModule(filename);
|
||||
+
|
||||
if (source === undefined) {
|
||||
({ source } = loadSourceForCJSWithHooks(module, filename, format));
|
||||
}
|
||||
diff --git a/lib/internal/modules/run_main.js b/lib/internal/modules/run_main.js
|
||||
index 02ba43adc2c8e92a78942bbb04023a16f5870ee9..bbf1ab69b884a9325bebdd07b2c4fd354eee946b 100644
|
||||
--- a/lib/internal/modules/run_main.js
|
||||
|
||||
@@ -8,10 +8,10 @@ an API override to replace the native `ReadFileSync` in the `modules`
|
||||
binding.
|
||||
|
||||
diff --git a/src/env_properties.h b/src/env_properties.h
|
||||
index 5cb8dd86fe712755fe09556d227702aec905fbc9..f1768da6ef82fa85700fecbdf9321653345e92c5 100644
|
||||
index 82225b0a53dd828750991a4e15a060b736b6ea2b..4b0d31356a2496a7fc67876a22da2453efc54f53 100644
|
||||
--- a/src/env_properties.h
|
||||
+++ b/src/env_properties.h
|
||||
@@ -506,6 +506,7 @@
|
||||
@@ -508,6 +508,7 @@
|
||||
V(maybe_cache_generated_source_map, v8::Function) \
|
||||
V(messaging_deserialize_create_object, v8::Function) \
|
||||
V(message_port, v8::Object) \
|
||||
|
||||
@@ -18,7 +18,7 @@ index 9519f947b8dfdc69808839948c9cb8434a0acf0e..23ce72d479f638c33edffcea7c35f5da
|
||||
|
||||
/**
|
||||
diff --git a/lib/internal/modules/esm/load.js b/lib/internal/modules/esm/load.js
|
||||
index e718d7b3e7c11addc78cf7af33c93f63a9cb247b..3334818153068468967baa5adc1ed2382592ec76 100644
|
||||
index 307c35980551470b65128bebf5efe94df4e56892..3676a9852bcd42de0a3a380de117de58035f757b 100644
|
||||
--- a/lib/internal/modules/esm/load.js
|
||||
+++ b/lib/internal/modules/esm/load.js
|
||||
@@ -81,7 +81,7 @@ function defaultLoad(url, context = kEmptyObject) {
|
||||
@@ -29,8 +29,8 @@ index e718d7b3e7c11addc78cf7af33c93f63a9cb247b..3334818153068468967baa5adc1ed238
|
||||
+ if (urlInstance.protocol === 'node:' || format === 'electron') {
|
||||
source = null;
|
||||
format ??= 'builtin';
|
||||
} else if (format !== 'commonjs' || defaultType === 'module') {
|
||||
@@ -94,7 +94,7 @@ function defaultLoad(url, context = kEmptyObject) {
|
||||
} else if (format === 'addon') {
|
||||
@@ -97,7 +97,7 @@ function defaultLoad(url, context = kEmptyObject) {
|
||||
// Now that we have the source for the module, run `defaultGetFormat` to detect its format.
|
||||
format = defaultGetFormat(urlInstance, context);
|
||||
|
||||
@@ -39,7 +39,7 @@ index e718d7b3e7c11addc78cf7af33c93f63a9cb247b..3334818153068468967baa5adc1ed238
|
||||
// For backward compatibility reasons, we need to discard the source in
|
||||
// order for the CJS loader to re-fetch it.
|
||||
source = null;
|
||||
@@ -142,7 +142,7 @@ function defaultLoadSync(url, context = kEmptyObject) {
|
||||
@@ -145,7 +145,7 @@ function defaultLoadSync(url, context = kEmptyObject) {
|
||||
|
||||
throwIfUnsupportedURLScheme(urlInstance, false);
|
||||
|
||||
@@ -48,7 +48,7 @@ index e718d7b3e7c11addc78cf7af33c93f63a9cb247b..3334818153068468967baa5adc1ed238
|
||||
source = null;
|
||||
} else if (source == null) {
|
||||
({ responseURL, source } = getSourceSync(urlInstance, context));
|
||||
@@ -175,12 +175,13 @@ function throwIfUnsupportedURLScheme(parsed) {
|
||||
@@ -178,12 +178,13 @@ function throwIfUnsupportedURLScheme(parsed) {
|
||||
protocol !== 'file:' &&
|
||||
protocol !== 'data:' &&
|
||||
protocol !== 'node:' &&
|
||||
@@ -64,10 +64,10 @@ index e718d7b3e7c11addc78cf7af33c93f63a9cb247b..3334818153068468967baa5adc1ed238
|
||||
}
|
||||
}
|
||||
diff --git a/lib/internal/modules/esm/loader.js b/lib/internal/modules/esm/loader.js
|
||||
index 87c14d1f84def72c1326e09154b38c417840634e..4491499e6da1724a7fd66b028a78ba145d6114aa 100644
|
||||
index 78985575beb3df7722ba90968e8f085574b5afdf..e032c016efe227c26364e81804ad183cd2c0d17f 100644
|
||||
--- a/lib/internal/modules/esm/loader.js
|
||||
+++ b/lib/internal/modules/esm/loader.js
|
||||
@@ -498,7 +498,7 @@ class ModuleLoader {
|
||||
@@ -504,7 +504,7 @@ class ModuleLoader {
|
||||
}
|
||||
|
||||
const cjsModule = wrap[imported_cjs_symbol];
|
||||
@@ -103,12 +103,12 @@ index 859b6bfedac4bbee2df054f9ebca7cbaaed45f18..5aa946f66c71beff0b7a43c30638ab28
|
||||
|
||||
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
|
||||
index d595ccbab8ce3042e83054e875eef612914115d8..7ea645b92a015b04cc121ff62aa1fc64b2961241 100644
|
||||
index 757f093becd112002f3422302f4c29bb464f1a6c..c8cea2117080930105b33e4e50586a2c88ef7352 100644
|
||||
--- a/lib/internal/modules/esm/translators.js
|
||||
+++ b/lib/internal/modules/esm/translators.js
|
||||
@@ -188,7 +188,7 @@ function createCJSModuleWrap(url, source, isMain, format, loadCJS = loadCJSModul
|
||||
|
||||
const { exportNames, module } = cjsPreparseModuleExports(filename, source, isMain, format);
|
||||
const { exportNames, module } = cjsPreparseModuleExports(filename, source, format);
|
||||
cjsCache.set(url, module);
|
||||
- const namesWithDefault = exportNames.has('default') ?
|
||||
+ const namesWithDefault = filename === 'electron' ? ['default', ...Object.keys(module.exports)] : exportNames.has('default') ?
|
||||
@@ -126,7 +126,7 @@ index d595ccbab8ce3042e83054e875eef612914115d8..7ea645b92a015b04cc121ff62aa1fc64
|
||||
continue;
|
||||
}
|
||||
// We might trigger a getter -> dont fail.
|
||||
@@ -245,6 +245,10 @@ translators.set('require-commonjs', (url, source, isMain) => {
|
||||
@@ -286,6 +286,10 @@ translators.set('require-commonjs', (url, source, isMain) => {
|
||||
return createCJSModuleWrap(url, source, isMain, 'commonjs');
|
||||
});
|
||||
|
||||
@@ -138,10 +138,10 @@ index d595ccbab8ce3042e83054e875eef612914115d8..7ea645b92a015b04cc121ff62aa1fc64
|
||||
// This translator function must be sync, as `require` is sync.
|
||||
translators.set('require-commonjs-typescript', (url, source, isMain) => {
|
||||
diff --git a/lib/internal/url.js b/lib/internal/url.js
|
||||
index b6057ae6656e03d98ea40c018369419749409c6d..9bd9abd49523406fd9ac77f2b5efe311da1fa9aa 100644
|
||||
index d0c04be7c6ebc352d5958a987f3a4ba538e0d23a..00f9f3b73ed84c04ae712f6057b68737bd416333 100644
|
||||
--- a/lib/internal/url.js
|
||||
+++ b/lib/internal/url.js
|
||||
@@ -1604,6 +1604,8 @@ function fileURLToPath(path, options = kEmptyObject) {
|
||||
@@ -1605,6 +1605,8 @@ function fileURLToPath(path, options = kEmptyObject) {
|
||||
path = new URL(path);
|
||||
else if (!isURL(path))
|
||||
throw new ERR_INVALID_ARG_TYPE('path', ['string', 'URL'], path);
|
||||
|
||||
@@ -228,7 +228,7 @@ index d94f6e1c82c4a62547b3b395f375c86ce4deb5de..b81b9005365272217c77e2b9289bd9f8
|
||||
X509View ca(sk_X509_value(peer_certs.get(), i));
|
||||
if (!cert->view().isIssuedBy(ca)) continue;
|
||||
diff --git a/src/crypto/crypto_context.cc b/src/crypto/crypto_context.cc
|
||||
index 5e368e3fd93b560c629aef720acd576f118cb1d6..ea5179ad5155cb599891d7421cd61df719ac4cae 100644
|
||||
index c08dab17fa229d1d67d3ad5174c97192989b2bd0..a3d309d832c73ddc79564b9644d825bec7459e7f 100644
|
||||
--- a/src/crypto/crypto_context.cc
|
||||
+++ b/src/crypto/crypto_context.cc
|
||||
@@ -141,7 +141,7 @@ int SSL_CTX_use_certificate_chain(SSL_CTX* ctx,
|
||||
@@ -240,7 +240,7 @@ index 5e368e3fd93b560c629aef720acd576f118cb1d6..ea5179ad5155cb599891d7421cd61df7
|
||||
X509* ca = sk_X509_value(extra_certs, i);
|
||||
|
||||
// NOTE: Increments reference count on `ca`
|
||||
@@ -1752,11 +1752,12 @@ void SecureContext::SetDHParam(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -1773,11 +1773,12 @@ void SecureContext::SetDHParam(const FunctionCallbackInfo<Value>& args) {
|
||||
// If the user specified "auto" for dhparams, the JavaScript layer will pass
|
||||
// true to this function instead of the original string. Any other string
|
||||
// value will be interpreted as custom DH parameters below.
|
||||
@@ -254,7 +254,7 @@ index 5e368e3fd93b560c629aef720acd576f118cb1d6..ea5179ad5155cb599891d7421cd61df7
|
||||
DHPointer dh;
|
||||
{
|
||||
BIOPointer bio(LoadBIO(env, args[0]));
|
||||
@@ -1982,7 +1983,7 @@ void SecureContext::LoadPKCS12(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -2003,7 +2004,7 @@ void SecureContext::LoadPKCS12(const FunctionCallbackInfo<Value>& args) {
|
||||
}
|
||||
|
||||
// Add CA certs too
|
||||
@@ -372,7 +372,7 @@ index c26a88b395abfc645da56231635b36fb23c8fa09..f23cedf4f2449d8edc9a8de1b70332e7
|
||||
UNREACHABLE();
|
||||
}
|
||||
diff --git a/src/crypto/crypto_dsa.cc b/src/crypto/crypto_dsa.cc
|
||||
index 471fee77531139ce988292470dff443fdfb05b07..931f7c2ae3d7e12afce471545d610d22f63412d7 100644
|
||||
index ca5edc8ebdf2550bb62b7969a5650733a2647f4f..198e18b58f31e361a9d2865cbe81e067e5f0b543 100644
|
||||
--- a/src/crypto/crypto_dsa.cc
|
||||
+++ b/src/crypto/crypto_dsa.cc
|
||||
@@ -43,7 +43,7 @@ namespace crypto {
|
||||
@@ -520,11 +520,11 @@ index 7c548d32b40365343f0e208c3aa856a1c847f4c3..6346f8f7199cf7b7d3736c59571606ff
|
||||
} // namespace
|
||||
|
||||
diff --git a/src/env.h b/src/env.h
|
||||
index c42493ad958508f650917bf5ca92088714a5056c..07accfbcca491966c6c8ad9c20e146dbd22347f0 100644
|
||||
index 874e5f4d15a75307e45cf70c06fc104fed843a6a..35e16159a94bb97f19d17767e3ad4bb798660f44 100644
|
||||
--- a/src/env.h
|
||||
+++ b/src/env.h
|
||||
@@ -50,7 +50,7 @@
|
||||
#include "uv.h"
|
||||
@@ -51,7 +51,7 @@
|
||||
#include "v8-profiler.h"
|
||||
#include "v8.h"
|
||||
|
||||
-#if HAVE_OPENSSL
|
||||
@@ -532,7 +532,7 @@ index c42493ad958508f650917bf5ca92088714a5056c..07accfbcca491966c6c8ad9c20e146db
|
||||
#include <openssl/evp.h>
|
||||
#endif
|
||||
|
||||
@@ -1076,7 +1076,7 @@ class Environment final : public MemoryRetainer {
|
||||
@@ -1077,7 +1077,7 @@ class Environment final : public MemoryRetainer {
|
||||
kExitInfoFieldCount
|
||||
};
|
||||
|
||||
@@ -542,11 +542,11 @@ index c42493ad958508f650917bf5ca92088714a5056c..07accfbcca491966c6c8ad9c20e146db
|
||||
// We declare another alias here to avoid having to include crypto_util.h
|
||||
using EVPMDPointer = DeleteFnPtr<EVP_MD, EVP_MD_free>;
|
||||
diff --git a/src/node_metadata.h b/src/node_metadata.h
|
||||
index 7b2072ad39c3f1a7c73101b25b69beb781141e26..d23536d88d21255d348175425a59e2424332cd19 100644
|
||||
index d9c533f100d25aeab1fe8589932a8ddead431258..2acab8786a8a752b17961445edeb872c2b08fdeb 100644
|
||||
--- a/src/node_metadata.h
|
||||
+++ b/src/node_metadata.h
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <string>
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <utility>
|
||||
#include "node_version.h"
|
||||
|
||||
-#if HAVE_OPENSSL
|
||||
@@ -555,7 +555,7 @@ index 7b2072ad39c3f1a7c73101b25b69beb781141e26..d23536d88d21255d348175425a59e242
|
||||
#if NODE_OPENSSL_HAS_QUIC
|
||||
#include <openssl/quic.h>
|
||||
diff --git a/src/node_options.cc b/src/node_options.cc
|
||||
index 249361e351946c16452124029c60fca52782adf9..653112fbaea59fe8b446236085dcae8be671c6e5 100644
|
||||
index ed85bf11f6f325823b59b3b0275908f9210c1b24..e3509abbc3bf84ac0edcd495eb3dde6219dbfc2d 100644
|
||||
--- a/src/node_options.cc
|
||||
+++ b/src/node_options.cc
|
||||
@@ -7,7 +7,7 @@
|
||||
@@ -568,7 +568,7 @@ index 249361e351946c16452124029c60fca52782adf9..653112fbaea59fe8b446236085dcae8b
|
||||
#endif
|
||||
|
||||
diff --git a/src/node_options.h b/src/node_options.h
|
||||
index 2a1a6aaf9f2d358ffffb0a8171df470686b9450e..3ff1f4b4baa64b8ee2a4587e150ea14cb2fdfdf4 100644
|
||||
index cdbd9ca39e907ab22515293eac2c5512223f4ca2..418dee360f867c363f1576012b32213a51c4fdd0 100644
|
||||
--- a/src/node_options.h
|
||||
+++ b/src/node_options.h
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: fix: lazyload fs in esm loaders to apply asar patches
|
||||
Changes { foo } from fs to just "fs.foo" so that our patching of fs is applied to esm loaders
|
||||
|
||||
diff --git a/lib/internal/modules/esm/load.js b/lib/internal/modules/esm/load.js
|
||||
index 3334818153068468967baa5adc1ed2382592ec76..ab4c8a4d00f1813e72f1ea8349850b40f55a393e 100644
|
||||
index 3676a9852bcd42de0a3a380de117de58035f757b..eaecfcfd8b922908957c3fefea65fb9deb445249 100644
|
||||
--- a/lib/internal/modules/esm/load.js
|
||||
+++ b/lib/internal/modules/esm/load.js
|
||||
@@ -10,7 +10,7 @@ const {
|
||||
@@ -50,10 +50,10 @@ index 5aa946f66c71beff0b7a43c30638ab28a1a5dfc0..e3afd30ba1f591d0298793bc42fd7166
|
||||
});
|
||||
const { search, hash } = resolved;
|
||||
diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js
|
||||
index 7ea645b92a015b04cc121ff62aa1fc64b2961241..8e099e0961b624c6143f5a60f050855b3366f177 100644
|
||||
index c8cea2117080930105b33e4e50586a2c88ef7352..2c33fd44b9a251682de78a8bcdad9ee5a0d3e5e8 100644
|
||||
--- a/lib/internal/modules/esm/translators.js
|
||||
+++ b/lib/internal/modules/esm/translators.js
|
||||
@@ -25,7 +25,7 @@ const {
|
||||
@@ -24,7 +24,7 @@ const {
|
||||
|
||||
const { BuiltinModule } = require('internal/bootstrap/realm');
|
||||
const assert = require('internal/assert');
|
||||
@@ -62,7 +62,7 @@ index 7ea645b92a015b04cc121ff62aa1fc64b2961241..8e099e0961b624c6143f5a60f050855b
|
||||
const { dirname, extname } = require('path');
|
||||
const {
|
||||
assertBufferSource,
|
||||
@@ -274,7 +274,7 @@ translators.set('commonjs', function commonjsStrategy(url, source, isMain) {
|
||||
@@ -315,7 +315,7 @@ translators.set('commonjs', function commonjsStrategy(url, source, isMain) {
|
||||
|
||||
try {
|
||||
// We still need to read the FS to detect the exports.
|
||||
|
||||
@@ -45,7 +45,7 @@ index ac00778cfc59fb55e361b24fc81a965a5e8f97e7..f0c4d6dfc9f03bee59e656b2da9ac325
|
||||
# define UV__EUNATCH UV__ERR(EUNATCH)
|
||||
#else
|
||||
diff --git a/src/node_constants.cc b/src/node_constants.cc
|
||||
index 8c44e32381a44675792ca0922e47df1adda48e41..d193725ea9a3270ed9affea12d11467fb14efdf8 100644
|
||||
index 0ca643aa74d13f278685d2330b791182b55c15b4..cbcecfba33070b820aca0e2814982160a97a6378 100644
|
||||
--- a/src/node_constants.cc
|
||||
+++ b/src/node_constants.cc
|
||||
@@ -241,10 +241,6 @@ void DefineErrnoConstants(Local<Object> target) {
|
||||
|
||||
@@ -194,10 +194,10 @@ index e39852c8e0392e0a9ae5d4ea58be115416e19233..c94b14741c827a81d69a6f036426a344
|
||||
|
||||
static const v8::CFunction fast_write_string_ascii(
|
||||
diff --git a/src/util.h b/src/util.h
|
||||
index dbec66247852df91c57c2a4e9664d2fea7d3dcef..efeb12d837db7b88093e4a6a2e20df562180ca1e 100644
|
||||
index dcd6548d41be786c42ce8328d89e532a8e9d43a2..7c98de621ca4d53cbaaa5bd4488aab20c7b033a7 100644
|
||||
--- a/src/util.h
|
||||
+++ b/src/util.h
|
||||
@@ -60,6 +60,7 @@
|
||||
@@ -62,6 +62,7 @@
|
||||
namespace node {
|
||||
|
||||
constexpr char kPathSeparator = std::filesystem::path::preferred_separator;
|
||||
@@ -205,7 +205,7 @@ index dbec66247852df91c57c2a4e9664d2fea7d3dcef..efeb12d837db7b88093e4a6a2e20df56
|
||||
|
||||
#ifdef _WIN32
|
||||
/* MAX_PATH is in characters, not bytes. Make sure we have enough headroom. */
|
||||
@@ -585,6 +586,16 @@ class BufferValue : public MaybeStackBuffer<char> {
|
||||
@@ -589,6 +590,16 @@ class BufferValue : public MaybeStackBuffer<char> {
|
||||
static_cast<char*>(name->Buffer()->Data()) + name##_offset; \
|
||||
if (name##_length > 0) CHECK_NE(name##_data, nullptr);
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ This patch can be removed when we upgrade to a V8 version that
|
||||
contains the above CLs.
|
||||
|
||||
diff --git a/src/node.cc b/src/node.cc
|
||||
index 1b5e989e5456a9bf77475e06250702029568c08d..61d65094aebd7f3016d51a8e7c9c761fc69cecba 100644
|
||||
index 07684482f855363e26c3d7299a585a8a5654015e..627337efae49319e2a77b4686176ce92a8493024 100644
|
||||
--- a/src/node.cc
|
||||
+++ b/src/node.cc
|
||||
@@ -816,7 +816,7 @@ static ExitCode ProcessGlobalArgsInternal(std::vector<std::string>* args,
|
||||
|
||||
@@ -18,10 +18,10 @@ This can be removed when Node.js upgrades to a version of V8 containing CLs
|
||||
from the above issue.
|
||||
|
||||
diff --git a/src/api/environment.cc b/src/api/environment.cc
|
||||
index 9e1b8d147a99fda962d75c343d0687ffea3c9c69..244d747f010c51366e44dec705ae304423038a85 100644
|
||||
index cb37fa080fc8e8d524cfa2758c4a8c2c5652324d..8e227ddd1be50c046a8cf2895a31d607eb7d31de 100644
|
||||
--- a/src/api/environment.cc
|
||||
+++ b/src/api/environment.cc
|
||||
@@ -313,6 +313,10 @@ Isolate* NewIsolate(Isolate::CreateParams* params,
|
||||
@@ -316,6 +316,10 @@ Isolate* NewIsolate(Isolate::CreateParams* params,
|
||||
MultiIsolatePlatform* platform,
|
||||
const SnapshotData* snapshot_data,
|
||||
const IsolateSettings& settings) {
|
||||
@@ -32,7 +32,7 @@ index 9e1b8d147a99fda962d75c343d0687ffea3c9c69..244d747f010c51366e44dec705ae3044
|
||||
Isolate* isolate = Isolate::Allocate();
|
||||
if (isolate == nullptr) return nullptr;
|
||||
|
||||
@@ -356,9 +360,12 @@ Isolate* NewIsolate(ArrayBufferAllocator* allocator,
|
||||
@@ -359,9 +363,12 @@ Isolate* NewIsolate(ArrayBufferAllocator* allocator,
|
||||
uv_loop_t* event_loop,
|
||||
MultiIsolatePlatform* platform,
|
||||
const EmbedderSnapshotData* snapshot_data,
|
||||
@@ -47,10 +47,10 @@ index 9e1b8d147a99fda962d75c343d0687ffea3c9c69..244d747f010c51366e44dec705ae3044
|
||||
event_loop,
|
||||
platform,
|
||||
diff --git a/src/env.cc b/src/env.cc
|
||||
index b6ad3ca99c8b0c656ce726fbc3455ba554bc3bd1..0922f7fb9c120482b6ee825f5f1ad10dea11fe30 100644
|
||||
index 20aad98e7af155d18fcfde167b1f465392298a6f..5fa667382bc957aee800d612f78b18c37a58c67f 100644
|
||||
--- a/src/env.cc
|
||||
+++ b/src/env.cc
|
||||
@@ -577,14 +577,6 @@ IsolateData::IsolateData(Isolate* isolate,
|
||||
@@ -578,14 +578,6 @@ IsolateData::IsolateData(Isolate* isolate,
|
||||
// We do not care about overflow since we just want this to be different
|
||||
// from the cppgc id.
|
||||
uint16_t non_cppgc_id = cppgc_id + 1;
|
||||
@@ -65,7 +65,7 @@ index b6ad3ca99c8b0c656ce726fbc3455ba554bc3bd1..0922f7fb9c120482b6ee825f5f1ad10d
|
||||
{
|
||||
// GC could still be run after the IsolateData is destroyed, so we store
|
||||
// the ids in a static map to ensure pointers to them are still valid
|
||||
@@ -607,15 +599,6 @@ IsolateData::IsolateData(Isolate* isolate,
|
||||
@@ -608,15 +600,6 @@ IsolateData::IsolateData(Isolate* isolate,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,10 +82,10 @@ index b6ad3ca99c8b0c656ce726fbc3455ba554bc3bd1..0922f7fb9c120482b6ee825f5f1ad10d
|
||||
void SetCppgcReference(Isolate* isolate,
|
||||
Local<Object> object,
|
||||
diff --git a/src/env.h b/src/env.h
|
||||
index 1079e3beb02e5f5d71a15fd2db65cb93ebd175d6..a7be609c3ab9093cec5145367b95ae6859936a24 100644
|
||||
index 2d5fa8dbd75851bca30453548f6cbe0159509f26..c346e3a9c827993036438685d758a734f9ce8c05 100644
|
||||
--- a/src/env.h
|
||||
+++ b/src/env.h
|
||||
@@ -155,7 +155,6 @@ class NODE_EXTERN_PRIVATE IsolateData : public MemoryRetainer {
|
||||
@@ -157,7 +157,6 @@ class NODE_EXTERN_PRIVATE IsolateData : public MemoryRetainer {
|
||||
ArrayBufferAllocator* node_allocator = nullptr,
|
||||
const EmbedderSnapshotData* embedder_snapshot_data = nullptr,
|
||||
std::shared_ptr<PerIsolateOptions> options = nullptr);
|
||||
@@ -93,7 +93,7 @@ index 1079e3beb02e5f5d71a15fd2db65cb93ebd175d6..a7be609c3ab9093cec5145367b95ae68
|
||||
|
||||
SET_MEMORY_INFO_NAME(IsolateData)
|
||||
SET_SELF_SIZE(IsolateData)
|
||||
@@ -258,7 +257,6 @@ class NODE_EXTERN_PRIVATE IsolateData : public MemoryRetainer {
|
||||
@@ -260,7 +259,6 @@ class NODE_EXTERN_PRIVATE IsolateData : public MemoryRetainer {
|
||||
const SnapshotData* snapshot_data_;
|
||||
std::optional<SnapshotConfig> snapshot_config_;
|
||||
|
||||
@@ -102,10 +102,10 @@ index 1079e3beb02e5f5d71a15fd2db65cb93ebd175d6..a7be609c3ab9093cec5145367b95ae68
|
||||
worker::Worker* worker_context_ = nullptr;
|
||||
PerIsolateWrapperData* wrapper_data_;
|
||||
diff --git a/src/node.cc b/src/node.cc
|
||||
index 61d65094aebd7f3016d51a8e7c9c761fc69cecba..0d383dcdb80fe30e3c2d6880b44f626f065bb1f3 100644
|
||||
index 627337efae49319e2a77b4686176ce92a8493024..f0c0b6229048a2e9bc05684fab44ab09bc34e1f6 100644
|
||||
--- a/src/node.cc
|
||||
+++ b/src/node.cc
|
||||
@@ -1271,6 +1271,14 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
|
||||
@@ -1295,6 +1295,14 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
|
||||
result->platform_ = per_process::v8_platform.Platform();
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ index 61d65094aebd7f3016d51a8e7c9c761fc69cecba..0d383dcdb80fe30e3c2d6880b44f626f
|
||||
if (!(flags & ProcessInitializationFlags::kNoInitializeV8)) {
|
||||
V8::Initialize();
|
||||
|
||||
@@ -1280,14 +1288,6 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
|
||||
@@ -1304,14 +1312,6 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
|
||||
absl::SetMutexDeadlockDetectionMode(absl::OnDeadlockCycle::kIgnore);
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ index 61d65094aebd7f3016d51a8e7c9c761fc69cecba..0d383dcdb80fe30e3c2d6880b44f626f
|
||||
bool use_wasm_trap_handler =
|
||||
!per_process::cli_options->disable_wasm_trap_handler;
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index 42d55d24bd0770795ae0c0e19241d25a6350ae08..4335c7cf53b7e08c95dcee3461384ac12c8ebe41 100644
|
||||
index d3a965661d068db359bb1bb4b14e59c28bb615f9..16a0c71aef949b0ddd27def9dc843298f9a6b75f 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -590,7 +590,8 @@ NODE_EXTERN v8::Isolate* NewIsolate(
|
||||
@@ -174,10 +174,10 @@ index 4119ac1b002681d39711eac810ca2fcc2702ffc7..790347056cde949ffe6cf8498a7eca0c
|
||||
|
||||
ExitCode NodeMainInstance::Run() {
|
||||
diff --git a/src/node_worker.cc b/src/node_worker.cc
|
||||
index e2dbdd39b06c4f2f85eba46cbf1383af144456c6..6c43928ba5a9752c78544d1c77198278eb11ccd7 100644
|
||||
index 29c4b1de42b3127a98871d200c80197bf974b31f..8555ab556b5b74a1cf9cf30747f1f417bfe4e4d9 100644
|
||||
--- a/src/node_worker.cc
|
||||
+++ b/src/node_worker.cc
|
||||
@@ -163,6 +163,9 @@ class WorkerThreadData {
|
||||
@@ -177,6 +177,9 @@ class WorkerThreadData {
|
||||
SetIsolateCreateParamsForNode(¶ms);
|
||||
w->UpdateResourceConstraints(¶ms.constraints);
|
||||
params.array_buffer_allocator_shared = allocator;
|
||||
@@ -187,7 +187,7 @@ index e2dbdd39b06c4f2f85eba46cbf1383af144456c6..6c43928ba5a9752c78544d1c77198278
|
||||
Isolate* isolate =
|
||||
NewIsolate(¶ms, &loop_, w->platform_, w->snapshot_data());
|
||||
if (isolate == nullptr) {
|
||||
@@ -231,13 +234,8 @@ class WorkerThreadData {
|
||||
@@ -245,13 +248,8 @@ class WorkerThreadData {
|
||||
*static_cast<bool*>(data) = true;
|
||||
}, &platform_finished);
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
|
||||
Reviewed-By: James M Snell <jasnell@gmail.com>
|
||||
|
||||
diff --git a/src/node_process_object.cc b/src/node_process_object.cc
|
||||
index 7dd24545fee674b25503b0fcff9b9af0d5c6a26a..5de8be7f8ed97e6b110e397fc4cacb9a246892b6 100644
|
||||
index 2e0d180d249c6925c761cb673a4a396905cc971c..5bf854723040859f841608f40ac43ea3d4a44b1e 100644
|
||||
--- a/src/node_process_object.cc
|
||||
+++ b/src/node_process_object.cc
|
||||
@@ -13,7 +13,6 @@
|
||||
@@ -44,7 +44,7 @@ index 7dd24545fee674b25503b0fcff9b9af0d5c6a26a..5de8be7f8ed97e6b110e397fc4cacb9a
|
||||
using v8::EscapableHandleScope;
|
||||
using v8::Function;
|
||||
using v8::FunctionCallbackInfo;
|
||||
@@ -186,13 +185,12 @@ void PatchProcessObject(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -168,13 +167,12 @@ void PatchProcessObject(const FunctionCallbackInfo<Value>& args) {
|
||||
|
||||
// process.title
|
||||
CHECK(process
|
||||
@@ -59,7 +59,7 @@ index 7dd24545fee674b25503b0fcff9b9af0d5c6a26a..5de8be7f8ed97e6b110e397fc4cacb9a
|
||||
None,
|
||||
SideEffectType::kHasNoSideEffect)
|
||||
.FromJust());
|
||||
@@ -211,9 +209,15 @@ void PatchProcessObject(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -193,9 +191,15 @@ void PatchProcessObject(const FunctionCallbackInfo<Value>& args) {
|
||||
READONLY_PROPERTY(process, "pid",
|
||||
Integer::New(isolate, uv_os_getpid()));
|
||||
|
||||
@@ -78,7 +78,7 @@ index 7dd24545fee674b25503b0fcff9b9af0d5c6a26a..5de8be7f8ed97e6b110e397fc4cacb9a
|
||||
|
||||
// --security-revert flags
|
||||
#define V(code, _, __) \
|
||||
@@ -238,12 +242,15 @@ void PatchProcessObject(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -220,12 +224,15 @@ void PatchProcessObject(const FunctionCallbackInfo<Value>& args) {
|
||||
|
||||
// process.debugPort
|
||||
CHECK(process
|
||||
|
||||
@@ -16,7 +16,7 @@ patch:
|
||||
(cherry picked from commit 30329d06235a9f9733b1d4da479b403462d1b326)
|
||||
|
||||
diff --git a/src/env-inl.h b/src/env-inl.h
|
||||
index 0d32d9f5a55da257a5e5a895a2ff002b780f96fe..9567d9499c62ea44cca651e87ab912ad55e2d90b 100644
|
||||
index 67b4cc2037b8e02f6382cd12a7abb157d0dbac65..4906c6c4c0ab5260d6e6387d0ed8e0687f982a38 100644
|
||||
--- a/src/env-inl.h
|
||||
+++ b/src/env-inl.h
|
||||
@@ -62,31 +62,6 @@ inline uv_loop_t* IsolateData::event_loop() const {
|
||||
@@ -52,7 +52,7 @@ index 0d32d9f5a55da257a5e5a895a2ff002b780f96fe..9567d9499c62ea44cca651e87ab912ad
|
||||
return &(wrapper_data_->cppgc_id);
|
||||
}
|
||||
diff --git a/src/env.cc b/src/env.cc
|
||||
index 63fdeeb26ba89284e74ca37050dfd170e7963331..b6ad3ca99c8b0c656ce726fbc3455ba554bc3bd1 100644
|
||||
index 926645dc647fe7ca01165462f08eac1ade71ac4e..20aad98e7af155d18fcfde167b1f465392298a6f 100644
|
||||
--- a/src/env.cc
|
||||
+++ b/src/env.cc
|
||||
@@ -23,6 +23,7 @@
|
||||
@@ -71,7 +71,7 @@ index 63fdeeb26ba89284e74ca37050dfd170e7963331..b6ad3ca99c8b0c656ce726fbc3455ba5
|
||||
using worker::Worker;
|
||||
|
||||
int const ContextEmbedderTag::kNodeContextTag = 0x6e6f64;
|
||||
@@ -529,6 +529,14 @@ void IsolateData::CreateProperties() {
|
||||
@@ -530,6 +530,14 @@ void IsolateData::CreateProperties() {
|
||||
CreateEnvProxyTemplate(this);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ index 63fdeeb26ba89284e74ca37050dfd170e7963331..b6ad3ca99c8b0c656ce726fbc3455ba5
|
||||
constexpr uint16_t kDefaultCppGCEmbedderID = 0x90de;
|
||||
Mutex IsolateData::isolate_data_mutex_;
|
||||
std::unordered_map<uint16_t, std::unique_ptr<PerIsolateWrapperData>>
|
||||
@@ -566,36 +574,16 @@ IsolateData::IsolateData(Isolate* isolate,
|
||||
@@ -567,36 +575,16 @@ IsolateData::IsolateData(Isolate* isolate,
|
||||
v8::CppHeap* cpp_heap = isolate->GetCppHeap();
|
||||
|
||||
uint16_t cppgc_id = kDefaultCppGCEmbedderID;
|
||||
@@ -130,7 +130,7 @@ index 63fdeeb26ba89284e74ca37050dfd170e7963331..b6ad3ca99c8b0c656ce726fbc3455ba5
|
||||
|
||||
{
|
||||
// GC could still be run after the IsolateData is destroyed, so we store
|
||||
@@ -628,11 +616,12 @@ IsolateData::~IsolateData() {
|
||||
@@ -629,11 +617,12 @@ IsolateData::~IsolateData() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,10 +146,10 @@ index 63fdeeb26ba89284e74ca37050dfd170e7963331..b6ad3ca99c8b0c656ce726fbc3455ba5
|
||||
|
||||
void IsolateData::MemoryInfo(MemoryTracker* tracker) const {
|
||||
diff --git a/src/env.h b/src/env.h
|
||||
index 07accfbcca491966c6c8ad9c20e146dbd22347f0..1079e3beb02e5f5d71a15fd2db65cb93ebd175d6 100644
|
||||
index 35e16159a94bb97f19d17767e3ad4bb798660f44..2d5fa8dbd75851bca30453548f6cbe0159509f26 100644
|
||||
--- a/src/env.h
|
||||
+++ b/src/env.h
|
||||
@@ -175,10 +175,6 @@ class NODE_EXTERN_PRIVATE IsolateData : public MemoryRetainer {
|
||||
@@ -177,10 +177,6 @@ class NODE_EXTERN_PRIVATE IsolateData : public MemoryRetainer {
|
||||
uint16_t* embedder_id_for_cppgc() const;
|
||||
uint16_t* embedder_id_for_non_cppgc() const;
|
||||
|
||||
@@ -161,10 +161,10 @@ index 07accfbcca491966c6c8ad9c20e146dbd22347f0..1079e3beb02e5f5d71a15fd2db65cb93
|
||||
inline MultiIsolatePlatform* platform() const;
|
||||
inline const SnapshotData* snapshot_data() const;
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index 174fd4d1af4c8cd75aec09f4548a674fd5539fb2..42d55d24bd0770795ae0c0e19241d25a6350ae08 100644
|
||||
index 96c599aa6448e2aa8e57e84f811564a5281c139a..d3a965661d068db359bb1bb4b14e59c28bb615f9 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -1560,24 +1560,14 @@ void RegisterSignalHandler(int signal,
|
||||
@@ -1576,24 +1576,14 @@ void RegisterSignalHandler(int signal,
|
||||
bool reset_handler = false);
|
||||
#endif // _WIN32
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ This refactors several allocators to allocate within the V8 memory cage,
|
||||
allowing them to be compatible with the V8_SANDBOXED_POINTERS feature.
|
||||
|
||||
diff --git a/src/api/environment.cc b/src/api/environment.cc
|
||||
index 50accbf4052da11d47a5200997f1098ed9d85354..9e1b8d147a99fda962d75c343d0687ffea3c9c69 100644
|
||||
index fd71ceac65ccef1d2832b45b0b5612877cee22c1..cb37fa080fc8e8d524cfa2758c4a8c2c5652324d 100644
|
||||
--- a/src/api/environment.cc
|
||||
+++ b/src/api/environment.cc
|
||||
@@ -103,6 +103,14 @@ MaybeLocal<Value> PrepareStackTraceCallback(Local<Context> context,
|
||||
@@ -106,6 +106,14 @@ MaybeLocal<Value> PrepareStackTraceCallback(Local<Context> context,
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -143,10 +143,10 @@ index 6346f8f7199cf7b7d3736c59571606fff102fbb6..7eea2eaefcad5780663a6b87985925ae
|
||||
void SecureHeapUsed(const FunctionCallbackInfo<Value>& args) {
|
||||
#ifndef OPENSSL_IS_BORINGSSL
|
||||
diff --git a/src/crypto/crypto_util.h b/src/crypto/crypto_util.h
|
||||
index 1592134716da2de40de4ba028ee937b765423e37..8f3ba65f1fef2c066d6df6087a08ba71100d1090 100644
|
||||
index ebc7fddeccf04a92c610849b626b33f900d63493..ed7d202d1b041f8a6cd43ae767d696fb29ab9cd9 100644
|
||||
--- a/src/crypto/crypto_util.h
|
||||
+++ b/src/crypto/crypto_util.h
|
||||
@@ -242,7 +242,7 @@ class ByteSource {
|
||||
@@ -243,7 +243,7 @@ class ByteSource {
|
||||
// Creates a v8::BackingStore that takes over responsibility for
|
||||
// any allocated data. The ByteSource will be reset with size = 0
|
||||
// after being called.
|
||||
@@ -229,10 +229,10 @@ index 61b6ecd240c9500f21f683065a2f920af3afb502..ad2b1c76325cb5c8f18a618c5a85ae87
|
||||
|
||||
constexpr const char* EncodingName(const enum encoding encoding) {
|
||||
diff --git a/src/node_internals.h b/src/node_internals.h
|
||||
index 275534285ec28f02b46639142ab4195b24267476..5f9d123f9d4b9feb7bc0b627b1e6309fdbd6e30d 100644
|
||||
index 12ea72b61b0a5e194207bb369dfed4b8667107cb..64442215714a98f648971e517ddd9c77e38fe3f2 100644
|
||||
--- a/src/node_internals.h
|
||||
+++ b/src/node_internals.h
|
||||
@@ -120,7 +120,9 @@ v8::MaybeLocal<v8::Object> InitializePrivateSymbols(
|
||||
@@ -121,7 +121,9 @@ v8::MaybeLocal<v8::Object> InitializePrivateSymbols(
|
||||
|
||||
class NodeArrayBufferAllocator : public ArrayBufferAllocator {
|
||||
public:
|
||||
@@ -243,7 +243,7 @@ index 275534285ec28f02b46639142ab4195b24267476..5f9d123f9d4b9feb7bc0b627b1e6309f
|
||||
|
||||
void* Allocate(size_t size) override; // Defined in src/node.cc
|
||||
void* AllocateUninitialized(size_t size) override;
|
||||
@@ -138,7 +140,7 @@ class NodeArrayBufferAllocator : public ArrayBufferAllocator {
|
||||
@@ -139,7 +141,7 @@ class NodeArrayBufferAllocator : public ArrayBufferAllocator {
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -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.
|
||||
|
||||
diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status
|
||||
index 0546a81ef11ec7ac8d6e214e4090b0e7b94bf70f..25b08be32c7a0aa501b64102f10c9bffc8c57970 100644
|
||||
index 67c0c04d2365e59db111258d008f8c73173e3e96..a4204e7580e7823399f6057d57c09cba56b5ff78 100644
|
||||
--- a/test/parallel/parallel.status
|
||||
+++ b/test/parallel/parallel.status
|
||||
@@ -5,6 +5,16 @@ prefix parallel
|
||||
@@ -28,7 +28,7 @@ index 0546a81ef11ec7ac8d6e214e4090b0e7b94bf70f..25b08be32c7a0aa501b64102f10c9bff
|
||||
test-net-write-fully-async-hex-string: PASS, FLAKY
|
||||
# https://github.com/nodejs/node/issues/52273
|
||||
diff --git a/test/sequential/sequential.status b/test/sequential/sequential.status
|
||||
index 6893abfe6e1c03d455099099f0d7e6b6930372a6..24aab3bad500ce4b9d43bf693c5efa6d563fe858 100644
|
||||
index 4ae3b6c5fd2eb633ae78bed1824046d862d7579b..d291954d4451b63aeb2bf46232e8705150eb9e79 100644
|
||||
--- a/test/sequential/sequential.status
|
||||
+++ b/test/sequential/sequential.status
|
||||
@@ -7,6 +7,18 @@ prefix sequential
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
chore_allow_customizing_microtask_policy_per_context.patch
|
||||
cherry-pick-ec6c18478382.patch
|
||||
allow_host_defined_serializer_of_jserror.patch
|
||||
|
||||
114
patches/v8/allow_host_defined_serializer_of_jserror.patch
Normal file
114
patches/v8/allow_host_defined_serializer_of_jserror.patch
Normal file
@@ -0,0 +1,114 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Chengzhong Wu <cwu631@bloomberg.net>
|
||||
Date: Wed, 18 Jun 2025 11:30:09 +0100
|
||||
Subject: allow host defined serializer of JSError
|
||||
|
||||
Allow host defined serializer and deserializer of JSError in
|
||||
ValueSerializer API. This allows hosts that implement DOMException
|
||||
in JS to support `Error.isError` proposal and `structuredClone`.
|
||||
|
||||
Refs: https://github.com/nodejs/node/pull/58691
|
||||
Change-Id: I022821c9abd659970c4d449b3c69c5fb54d0618a
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6637876
|
||||
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
|
||||
Commit-Queue: Chengzhong Wu <cwu631@bloomberg.net>
|
||||
Cr-Commit-Position: refs/heads/main@{#100894}
|
||||
|
||||
diff --git a/src/objects/value-serializer.cc b/src/objects/value-serializer.cc
|
||||
index cbe488faacf6f830b17d44a584bc6abbfd16f688..10c1099691ae24f1e5b4b1f71f3c60bf25638a95 100644
|
||||
--- a/src/objects/value-serializer.cc
|
||||
+++ b/src/objects/value-serializer.cc
|
||||
@@ -654,8 +654,17 @@ Maybe<bool> ValueSerializer::WriteJSReceiver(
|
||||
case JS_DATA_VIEW_TYPE:
|
||||
case JS_RAB_GSAB_DATA_VIEW_TYPE:
|
||||
return WriteJSArrayBufferView(Cast<JSArrayBufferView>(*receiver));
|
||||
- case JS_ERROR_TYPE:
|
||||
- return WriteJSError(Cast<JSObject>(receiver));
|
||||
+ case JS_ERROR_TYPE: {
|
||||
+ DirectHandle<JSObject> js_error = Cast<JSObject>(receiver);
|
||||
+ Maybe<bool> is_host_object = IsHostObject(js_error);
|
||||
+ if (is_host_object.IsNothing()) {
|
||||
+ return is_host_object;
|
||||
+ }
|
||||
+ if (is_host_object.FromJust()) {
|
||||
+ return WriteHostObject(js_error);
|
||||
+ }
|
||||
+ return WriteJSError(js_error);
|
||||
+ }
|
||||
case JS_SHARED_ARRAY_TYPE:
|
||||
return WriteJSSharedArray(Cast<JSSharedArray>(receiver));
|
||||
case JS_SHARED_STRUCT_TYPE:
|
||||
diff --git a/test/unittests/objects/value-serializer-unittest.cc b/test/unittests/objects/value-serializer-unittest.cc
|
||||
index 408f3831671c21a53da7f925892ebb318e3c540e..a97e3341cee9f366f3107ad8d73f37fce4f5b6de 100644
|
||||
--- a/test/unittests/objects/value-serializer-unittest.cc
|
||||
+++ b/test/unittests/objects/value-serializer-unittest.cc
|
||||
@@ -3141,6 +3141,69 @@ TEST_F(ValueSerializerTestWithHostObject, RoundTripHostJSObject) {
|
||||
ExpectScriptTrue("result.a === result.b");
|
||||
}
|
||||
|
||||
+TEST_F(ValueSerializerTestWithHostObject, RoundTripJSErrorObject) {
|
||||
+ i::DisableHandleChecksForMockingScope mocking_scope;
|
||||
+
|
||||
+ EXPECT_CALL(serializer_delegate_, HasCustomHostObject(isolate()))
|
||||
+ .WillOnce(Invoke([](Isolate* isolate) { return true; }));
|
||||
+ EXPECT_CALL(serializer_delegate_, IsHostObject(isolate(), _))
|
||||
+ .WillRepeatedly(Invoke([this](Isolate* isolate, Local<Object> object) {
|
||||
+ EXPECT_TRUE(object->IsObject());
|
||||
+ Local<Context> context = isolate->GetCurrentContext();
|
||||
+ return object->Has(context, StringFromUtf8("my_host_object"));
|
||||
+ }));
|
||||
+ // Read/Write HostObject methods are not invoked for non-host JSErrors.
|
||||
+ EXPECT_CALL(serializer_delegate_, WriteHostObject(isolate(), _)).Times(0);
|
||||
+ EXPECT_CALL(deserializer_delegate_, ReadHostObject(isolate())).Times(0);
|
||||
+
|
||||
+ RoundTripTest(
|
||||
+ "var e = new Error('before serialize');"
|
||||
+ "({ a: e, get b() { return this.a; } })");
|
||||
+ ExpectScriptTrue("!('my_host_object' in result)");
|
||||
+ ExpectScriptTrue("!('my_host_object' in result.a)");
|
||||
+ ExpectScriptTrue("result.a.message === 'before serialize'");
|
||||
+ ExpectScriptTrue("result.a instanceof Error");
|
||||
+ ExpectScriptTrue("result.a === result.b");
|
||||
+}
|
||||
+
|
||||
+TEST_F(ValueSerializerTestWithHostObject, RoundTripHostJSErrorObject) {
|
||||
+ i::DisableHandleChecksForMockingScope mocking_scope;
|
||||
+
|
||||
+ EXPECT_CALL(serializer_delegate_, HasCustomHostObject(isolate()))
|
||||
+ .WillOnce(Invoke([](Isolate* isolate) { return true; }));
|
||||
+ EXPECT_CALL(serializer_delegate_, IsHostObject(isolate(), _))
|
||||
+ .WillRepeatedly(Invoke([this](Isolate* isolate, Local<Object> object) {
|
||||
+ EXPECT_TRUE(object->IsObject());
|
||||
+ Local<Context> context = isolate->GetCurrentContext();
|
||||
+ return object->Has(context, StringFromUtf8("my_host_object"));
|
||||
+ }));
|
||||
+ EXPECT_CALL(serializer_delegate_, WriteHostObject(isolate(), _))
|
||||
+ .WillOnce(Invoke([this](Isolate*, Local<Object> object) {
|
||||
+ EXPECT_TRUE(object->IsObject());
|
||||
+ WriteExampleHostObjectTag();
|
||||
+ return Just(true);
|
||||
+ }));
|
||||
+ EXPECT_CALL(deserializer_delegate_, ReadHostObject(isolate()))
|
||||
+ .WillOnce(Invoke([this](Isolate* isolate) {
|
||||
+ EXPECT_TRUE(ReadExampleHostObjectTag());
|
||||
+ Local<Context> context = isolate->GetCurrentContext();
|
||||
+ Local<Object> obj =
|
||||
+ v8::Exception::Error(StringFromUtf8("deserialized")).As<Object>();
|
||||
+ obj->Set(context, StringFromUtf8("my_host_object"), v8::True(isolate))
|
||||
+ .Check();
|
||||
+ return obj;
|
||||
+ }));
|
||||
+ RoundTripTest(
|
||||
+ "var e = new Error('before serialize');"
|
||||
+ "e.my_host_object = true;"
|
||||
+ "({ a: e, get b() { return this.a; } })");
|
||||
+ ExpectScriptTrue("!('my_host_object' in result)");
|
||||
+ ExpectScriptTrue("result.a.my_host_object");
|
||||
+ ExpectScriptTrue("result.a.message === 'deserialized'");
|
||||
+ ExpectScriptTrue("result.a instanceof Error");
|
||||
+ ExpectScriptTrue("result.a === result.b");
|
||||
+}
|
||||
+
|
||||
class ValueSerializerTestWithHostArrayBufferView
|
||||
: public ValueSerializerTestWithHostObject {
|
||||
protected:
|
||||
96
script/build-stats.mjs
Normal file
96
script/build-stats.mjs
Normal file
@@ -0,0 +1,96 @@
|
||||
import * as fs from 'node:fs/promises';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { parseArgs } from 'node:util';
|
||||
|
||||
async function main () {
|
||||
const { positionals: [filename], values: { 'upload-stats': uploadStats } } = parseArgs({
|
||||
allowPositionals: true,
|
||||
options: {
|
||||
'upload-stats': {
|
||||
type: 'boolean',
|
||||
default: false
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (!filename) {
|
||||
throw new Error('filename is required (should be a siso.INFO file)');
|
||||
}
|
||||
|
||||
const log = await fs.readFile(filename, 'utf-8');
|
||||
|
||||
// We expect to find a line which looks like stats=build.Stats{..., CacheHit:39008, Local:4778, Remote:0, LocalFallback:0, ...}
|
||||
const match = log.match(/stats=build\.Stats{(.*)}/);
|
||||
|
||||
if (!match) {
|
||||
throw new Error('could not find stats=build.Stats in log');
|
||||
}
|
||||
|
||||
const stats = Object.fromEntries(match[1].split(',').map(part => {
|
||||
const [key, value] = part.trim().split(':');
|
||||
return [key, parseInt(value)];
|
||||
}));
|
||||
const hitRate = stats.CacheHit / (stats.Remote + stats.CacheHit + stats.LocalFallback);
|
||||
|
||||
console.log(`Effective cache hit rate: ${(hitRate * 100).toFixed(2)}%`);
|
||||
|
||||
if (uploadStats) {
|
||||
if (!process.env.DD_API_KEY) {
|
||||
throw new Error('DD_API_KEY is not set');
|
||||
}
|
||||
|
||||
const timestamp = Math.round(new Date().getTime() / 1000);
|
||||
|
||||
const tags = [];
|
||||
|
||||
if (process.env.TARGET_ARCH) tags.push(`target-arch:${process.env.TARGET_ARCH}`);
|
||||
if (process.env.TARGET_PLATFORM) tags.push(`target-platform:${process.env.TARGET_PLATFORM}`);
|
||||
if (process.env.GITHUB_HEAD_REF) {
|
||||
// Will be set in pull requests
|
||||
tags.push(`branch:${process.env.GITHUB_HEAD_REF}`);
|
||||
} else if (process.env.GITHUB_REF_NAME) {
|
||||
// Will be set for release branches
|
||||
tags.push(`branch:${process.env.GITHUB_REF_NAME}`);
|
||||
}
|
||||
|
||||
const series = [
|
||||
{
|
||||
metric: 'electron.build.effective-cache-hit-rate',
|
||||
points: [{ timestamp, value: (hitRate * 100).toFixed(2) }],
|
||||
type: 3, // GAUGE
|
||||
unit: 'percent',
|
||||
tags
|
||||
}
|
||||
];
|
||||
|
||||
// Add all raw stats as individual metrics
|
||||
for (const [key, value] of Object.entries(stats)) {
|
||||
series.push({
|
||||
metric: `electron.build.stats.${key.toLowerCase()}`,
|
||||
points: [{ timestamp, value }],
|
||||
type: 1, // COUNT
|
||||
tags
|
||||
});
|
||||
}
|
||||
|
||||
await fetch('https://api.datadoghq.com/api/v2/series', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'DD-API-KEY': process.env.DD_API_KEY
|
||||
},
|
||||
body: JSON.stringify({ series })
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if ((await fs.realpath(process.argv[1])) === fileURLToPath(import.meta.url)) {
|
||||
main()
|
||||
.then(() => {
|
||||
process.exit(0);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(`ERROR: ${err.message}`);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
@@ -210,8 +210,10 @@ function assetsForVersion (version: string, validatingRelease: boolean) {
|
||||
const cloudStoreFilePaths = (version: string) => [
|
||||
`iojs-${version}-headers.tar.gz`,
|
||||
`iojs-${version}.tar.gz`,
|
||||
`node-${version}-headers.tar.gz`,
|
||||
`node-${version}.tar.gz`,
|
||||
'node.lib',
|
||||
'arm64/node.lib',
|
||||
'x64/node.lib',
|
||||
'win-x64/iojs.lib',
|
||||
'win-x86/iojs.lib',
|
||||
@@ -219,7 +221,6 @@ const cloudStoreFilePaths = (version: string) => [
|
||||
'win-x64/node.lib',
|
||||
'win-x86/node.lib',
|
||||
'win-arm64/node.lib',
|
||||
'arm64/node.lib',
|
||||
'SHASUMS.txt',
|
||||
'SHASUMS256.txt'
|
||||
];
|
||||
|
||||
@@ -48,7 +48,7 @@ const targetRepo = getRepo();
|
||||
const uploadUrl = `https://uploads.github.com/repos/electron/${targetRepo}/releases/${releaseId}/assets{?name,label}`;
|
||||
let retry = 0;
|
||||
|
||||
const octokit = new Octokit({
|
||||
let octokit = new Octokit({
|
||||
authStrategy: createGitHubTokenStrategy(targetRepo),
|
||||
log: console
|
||||
});
|
||||
@@ -73,6 +73,12 @@ function uploadToGitHub () {
|
||||
console.log(`Error uploading ${fileName} to GitHub, will retry. Error was:`, err);
|
||||
retry++;
|
||||
|
||||
// Reset octokit in case it cached an auth error somehow
|
||||
octokit = new Octokit({
|
||||
authStrategy: createGitHubTokenStrategy(targetRepo),
|
||||
log: console
|
||||
});
|
||||
|
||||
octokit.repos.listReleaseAssets({
|
||||
owner: ELECTRON_ORG,
|
||||
repo: targetRepo,
|
||||
@@ -98,6 +104,7 @@ function uploadToGitHub () {
|
||||
}
|
||||
}).catch((getReleaseErr) => {
|
||||
console.log('Fatal: Unable to get current release assets via getRelease! Error was:', getReleaseErr);
|
||||
process.exitCode = 1;
|
||||
});
|
||||
} else {
|
||||
console.log(`Error retrying uploading ${fileName} to GitHub:`, err);
|
||||
|
||||
@@ -31,15 +31,15 @@ namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
void SetWindowBorderAndCaptionColor(HWND hwnd, COLORREF color) {
|
||||
if (base::win::GetVersion() < base::win::Version::WIN11)
|
||||
return;
|
||||
void SetWindowBorderAndCaptionColor(HWND hwnd, COLORREF color, bool has_frame) {
|
||||
HRESULT result;
|
||||
if (has_frame) {
|
||||
result =
|
||||
DwmSetWindowAttribute(hwnd, DWMWA_CAPTION_COLOR, &color, sizeof(color));
|
||||
|
||||
HRESULT result =
|
||||
DwmSetWindowAttribute(hwnd, DWMWA_CAPTION_COLOR, &color, sizeof(color));
|
||||
|
||||
if (FAILED(result))
|
||||
LOG(WARNING) << "Failed to set caption color";
|
||||
if (FAILED(result))
|
||||
LOG(WARNING) << "Failed to set caption color";
|
||||
}
|
||||
|
||||
result =
|
||||
DwmSetWindowAttribute(hwnd, DWMWA_BORDER_COLOR, &color, sizeof(color));
|
||||
@@ -509,7 +509,7 @@ void NativeWindowViews::HandleSizeEvent(WPARAM w_param, LPARAM l_param) {
|
||||
WINDOWPLACEMENT wp;
|
||||
wp.length = sizeof(WINDOWPLACEMENT);
|
||||
|
||||
if (GetWindowPlacement(GetAcceleratedWidget(), &wp)) {
|
||||
if (GetWindowPlacement(GetAcceleratedWidget(), &wp) && !was_snapped_) {
|
||||
last_normal_placement_bounds_ = gfx::Rect(wp.rcNormalPosition);
|
||||
}
|
||||
|
||||
@@ -518,11 +518,9 @@ void NativeWindowViews::HandleSizeEvent(WPARAM w_param, LPARAM l_param) {
|
||||
if (w_param == SIZE_MAXIMIZED &&
|
||||
last_window_state_ != ui::mojom::WindowShowState::kMaximized) {
|
||||
if (last_window_state_ == ui::mojom::WindowShowState::kMinimized) {
|
||||
if (was_snapped_) {
|
||||
SetRoundedCorners(false);
|
||||
was_snapped_ = false;
|
||||
}
|
||||
NotifyWindowRestore();
|
||||
if (was_snapped_)
|
||||
was_snapped_ = false;
|
||||
}
|
||||
last_window_state_ = ui::mojom::WindowShowState::kMaximized;
|
||||
NotifyWindowMaximize();
|
||||
@@ -545,12 +543,10 @@ void NativeWindowViews::HandleSizeEvent(WPARAM w_param, LPARAM l_param) {
|
||||
last_window_state_ = ui::mojom::WindowShowState::kFullscreen;
|
||||
NotifyWindowEnterFullScreen();
|
||||
} else {
|
||||
if (was_snapped_) {
|
||||
SetRoundedCorners(false);
|
||||
was_snapped_ = false;
|
||||
}
|
||||
last_window_state_ = ui::mojom::WindowShowState::kNormal;
|
||||
NotifyWindowRestore();
|
||||
if (was_snapped_)
|
||||
was_snapped_ = false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -595,7 +591,8 @@ void NativeWindowViews::UpdateWindowAccentColor(bool active) {
|
||||
}
|
||||
|
||||
COLORREF final_color = border_color.value_or(DWMWA_COLOR_DEFAULT);
|
||||
SetWindowBorderAndCaptionColor(GetAcceleratedWidget(), final_color);
|
||||
SetWindowBorderAndCaptionColor(GetAcceleratedWidget(), final_color,
|
||||
has_frame());
|
||||
}
|
||||
|
||||
void NativeWindowViews::SetAccentColor(
|
||||
|
||||
@@ -401,7 +401,7 @@ void ProxyingWebSocket::OnHeadersReceivedCompleteForAuth(
|
||||
|
||||
auto continuation = base::BindRepeating(
|
||||
&ProxyingWebSocket::OnAuthRequiredComplete, weak_factory_.GetWeakPtr());
|
||||
auto auth_rv = AuthRequiredResponse::kIoPending;
|
||||
auto auth_rv = AuthRequiredResponse::kCancelAuth;
|
||||
PauseIncomingMethodCallProcessing();
|
||||
|
||||
OnAuthRequiredComplete(auth_rv);
|
||||
|
||||
@@ -163,8 +163,19 @@ DialogResult ShowTaskDialogWstr(gfx::AcceleratedWidget parent,
|
||||
config.dwFlags |= TDF_POSITION_RELATIVE_TO_WINDOW;
|
||||
}
|
||||
|
||||
if (default_id > 0)
|
||||
config.nDefaultButton = kIDStart + default_id;
|
||||
if (default_id >= 0 &&
|
||||
base::checked_cast<size_t>(default_id) < buttons.size()) {
|
||||
if (!no_link) {
|
||||
auto common = GetCommonID(buttons[default_id]);
|
||||
if (common.button != -1) {
|
||||
config.nDefaultButton = common.id;
|
||||
} else {
|
||||
config.nDefaultButton = kIDStart + default_id;
|
||||
}
|
||||
} else {
|
||||
config.nDefaultButton = kIDStart + default_id;
|
||||
}
|
||||
}
|
||||
|
||||
// TaskDialogIndirect doesn't allow empty name, if we set empty title it
|
||||
// will show "electron.exe" in title.
|
||||
|
||||
@@ -191,13 +191,15 @@ class Archive : public node::ObjectWrap {
|
||||
static void SplitPath(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||
auto* isolate = args.GetIsolate();
|
||||
|
||||
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
|
||||
args.GetReturnValue().Set(dict.GetHandle());
|
||||
|
||||
base::FilePath path;
|
||||
if (!gin::ConvertFromV8(isolate, args[0], &path)) {
|
||||
args.GetReturnValue().Set(v8::False(isolate));
|
||||
dict.Set("isAsar", false);
|
||||
return;
|
||||
}
|
||||
|
||||
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
|
||||
base::FilePath asar_path, file_path;
|
||||
if (asar::GetAsarArchivePath(path, &asar_path, &file_path, true)) {
|
||||
dict.Set("isAsar", true);
|
||||
@@ -206,7 +208,6 @@ static void SplitPath(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||
} else {
|
||||
dict.Set("isAsar", false);
|
||||
}
|
||||
args.GetReturnValue().Set(dict.GetHandle());
|
||||
}
|
||||
|
||||
void Initialize(v8::Local<v8::Object> exports,
|
||||
|
||||
@@ -471,6 +471,39 @@ describe('BrowserView module', () => {
|
||||
w.webContents.loadURL('about:blank');
|
||||
await once(w.webContents, 'did-finish-load');
|
||||
});
|
||||
|
||||
it('document visibilitychange does not change when adding the same BrowserView multiple times', async () => {
|
||||
w.show();
|
||||
expect(w.isVisible()).to.be.true('w is visible');
|
||||
|
||||
const view = new BrowserView();
|
||||
const [width, height] = w.getSize();
|
||||
view.setBounds({ x: 0, y: 0, width, height });
|
||||
w.addBrowserView(view);
|
||||
expect(view.ownerWindow).to.equal(w);
|
||||
|
||||
await view.webContents.loadURL(`data:text/html,
|
||||
<html>
|
||||
<body>
|
||||
<h1>HELLO BROWSERVIEW</h1>
|
||||
<script>
|
||||
document.visibilityChangeCount = 0;
|
||||
document.addEventListener('visibilitychange', () => {
|
||||
document.visibilityChangeCount++;
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
`);
|
||||
const query = 'document.visibilityChangeCount';
|
||||
const countBefore = await view.webContents.executeJavaScript(query);
|
||||
expect(countBefore).to.equal(0);
|
||||
|
||||
w.addBrowserView(view);
|
||||
w.addBrowserView(view);
|
||||
const countAfter = await view.webContents.executeJavaScript(query);
|
||||
expect(countAfter).to.equal(countBefore);
|
||||
});
|
||||
});
|
||||
|
||||
describe('BrowserWindow.removeBrowserView()', () => {
|
||||
|
||||
Reference in New Issue
Block a user