From 344ec3dd353d555e906803b71e41dd6f6fbcfac9 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 6 Feb 2023 15:13:48 +0100 Subject: [PATCH] src: add support for externally shared js builtins https://github.com/nodejs/node/pull/44376 --- ...ion_of_original-fs_and_custom_embedder_js.patch | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch b/patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch index a18c4168ba715..5a4951f76d95e 100644 --- a/patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch +++ b/patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch @@ -14,10 +14,10 @@ renderer/browser/worker/sandboxed bootstrap scripts). These are loaded through LoadEmbedderJavaScriptSource() diff --git a/lib/internal/fs/watchers.js b/lib/internal/fs/watchers.js -index 7b820e70df1613a9f5565d6221b71354ff059560..405bda5d83c3312909439082ef69e8f266e53c2e 100644 +index bc4555584ab1f97806a1e9cd17085a2488320908..b17dbf2a98c9f4b14fea60c87f05afcee6ec54fb 100644 --- a/lib/internal/fs/watchers.js +++ b/lib/internal/fs/watchers.js -@@ -290,11 +290,13 @@ function emitCloseNT(self) { +@@ -293,11 +293,13 @@ function emitCloseNT(self) { // Legacy alias on the C++ wrapper object. This is not public API, so we may // want to runtime-deprecate it at some point. There's no hurry, though. @@ -28,26 +28,26 @@ index 7b820e70df1613a9f5565d6221b71354ff059560..405bda5d83c3312909439082ef69e8f2 -}); +if (!'owner' in FSEvent.prototype) { + ObjectDefineProperty(FSEvent.prototype, 'owner', { -+ __proto__: null, ++ __proto__: null, + get() { return this[owner_symbol]; }, + set(v) { return this[owner_symbol] = v; } + }); +} - async function* watch(filename, options = {}) { + async function* watch(filename, options = kEmptyObject) { const path = toNamespacedPath(getValidatedPath(filename)); diff --git a/src/node_builtins.cc b/src/node_builtins.cc -index 9d82a06adcefe386ea230c7cfbdccffb67d0b8c1..6e1a55adbd0b01383f3e54e924864dfeb6a57f0b 100644 +index 40d9025746d3c39cf9ea27b6cffc8f2eb7e62c1e..d3a0dd7cedb0d239ae427d1af2335e155345a454 100644 --- a/src/node_builtins.cc +++ b/src/node_builtins.cc -@@ -32,6 +32,7 @@ BuiltinLoader BuiltinLoader::instance_; +@@ -33,6 +33,7 @@ BuiltinLoader BuiltinLoader::instance_; BuiltinLoader::BuiltinLoader() : config_(GetConfig()), has_code_cache_(false) { LoadJavaScriptSource(); + LoadEmbedderJavaScriptSource(); - #if defined(NODE_HAVE_I18N_SUPPORT) #ifdef NODE_SHARED_BUILTIN_CJS_MODULE_LEXER_LEXER_PATH AddExternalizedBuiltin( + "internal/deps/cjs-module-lexer/lexer", diff --git a/src/node_builtins.h b/src/node_builtins.h index a6fbff98ccb0a7f5fd33cf3b084cfdf47aaa995e..8228e57d27b2f883d87ec12274f2745628caa6e1 100644 --- a/src/node_builtins.h