Skip to content

Commit 344ec3d

Browse files
committed
src: add support for externally shared js builtins
nodejs/node#44376
1 parent 1a25030 commit 344ec3d

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ renderer/browser/worker/sandboxed bootstrap scripts). These are loaded
1414
through LoadEmbedderJavaScriptSource()
1515

1616
diff --git a/lib/internal/fs/watchers.js b/lib/internal/fs/watchers.js
17-
index 7b820e70df1613a9f5565d6221b71354ff059560..405bda5d83c3312909439082ef69e8f266e53c2e 100644
17+
index bc4555584ab1f97806a1e9cd17085a2488320908..b17dbf2a98c9f4b14fea60c87f05afcee6ec54fb 100644
1818
--- a/lib/internal/fs/watchers.js
1919
+++ b/lib/internal/fs/watchers.js
20-
@@ -290,11 +290,13 @@ function emitCloseNT(self) {
20+
@@ -293,11 +293,13 @@ function emitCloseNT(self) {
2121

2222
// Legacy alias on the C++ wrapper object. This is not public API, so we may
2323
// want to runtime-deprecate it at some point. There's no hurry, though.
@@ -28,26 +28,26 @@ index 7b820e70df1613a9f5565d6221b71354ff059560..405bda5d83c3312909439082ef69e8f2
2828
-});
2929
+if (!'owner' in FSEvent.prototype) {
3030
+ ObjectDefineProperty(FSEvent.prototype, 'owner', {
31-
+ __proto__: null,
31+
+ __proto__: null,
3232
+ get() { return this[owner_symbol]; },
3333
+ set(v) { return this[owner_symbol] = v; }
3434
+ });
3535
+}
3636

37-
async function* watch(filename, options = {}) {
37+
async function* watch(filename, options = kEmptyObject) {
3838
const path = toNamespacedPath(getValidatedPath(filename));
3939
diff --git a/src/node_builtins.cc b/src/node_builtins.cc
40-
index 9d82a06adcefe386ea230c7cfbdccffb67d0b8c1..6e1a55adbd0b01383f3e54e924864dfeb6a57f0b 100644
40+
index 40d9025746d3c39cf9ea27b6cffc8f2eb7e62c1e..d3a0dd7cedb0d239ae427d1af2335e155345a454 100644
4141
--- a/src/node_builtins.cc
4242
+++ b/src/node_builtins.cc
43-
@@ -32,6 +32,7 @@ BuiltinLoader BuiltinLoader::instance_;
43+
@@ -33,6 +33,7 @@ BuiltinLoader BuiltinLoader::instance_;
4444

4545
BuiltinLoader::BuiltinLoader() : config_(GetConfig()), has_code_cache_(false) {
4646
LoadJavaScriptSource();
4747
+ LoadEmbedderJavaScriptSource();
48-
#if defined(NODE_HAVE_I18N_SUPPORT)
4948
#ifdef NODE_SHARED_BUILTIN_CJS_MODULE_LEXER_LEXER_PATH
5049
AddExternalizedBuiltin(
50+
"internal/deps/cjs-module-lexer/lexer",
5151
diff --git a/src/node_builtins.h b/src/node_builtins.h
5252
index a6fbff98ccb0a7f5fd33cf3b084cfdf47aaa995e..8228e57d27b2f883d87ec12274f2745628caa6e1 100644
5353
--- a/src/node_builtins.h

0 commit comments

Comments
 (0)