Skip to content

Commit 8e6400c

Browse files
committed
chore: update build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch
Xref: nodejs/node#46930 manually sync patch to minor upstream code shear
1 parent c6e7879 commit 8e6400c

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

‎patches/node/build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ 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 ce885c154c81c5703365fa34957697698da9aff6..229b0d522aeee3632145c86715bea1394d496bc4 100644
17+
index ce885c154c..229b0d522a 100644
1818
--- a/lib/internal/fs/watchers.js
1919
+++ b/lib/internal/fs/watchers.js
2020
@@ -293,11 +293,13 @@ function emitCloseNT(self) {
@@ -37,7 +37,7 @@ index ce885c154c81c5703365fa34957697698da9aff6..229b0d522aeee3632145c86715bea139
3737
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 40d9025746d3c39cf9ea27b6cffc8f2eb7e62c1e..d3a0dd7cedb0d239ae427d1af2335e155345a454 100644
40+
index 2220869fa7..522670ed5c 100644
4141
--- a/src/node_builtins.cc
4242
+++ b/src/node_builtins.cc
4343
@@ -33,6 +33,7 @@ BuiltinLoader BuiltinLoader::instance_;
@@ -49,7 +49,7 @@ index 40d9025746d3c39cf9ea27b6cffc8f2eb7e62c1e..d3a0dd7cedb0d239ae427d1af2335e15
4949
AddExternalizedBuiltin(
5050
"internal/deps/cjs-module-lexer/lexer",
5151
diff --git a/src/node_builtins.h b/src/node_builtins.h
52-
index 90b158b84bb2a66781cf92f5b4c1a64f9e2ee651..8d9f7c409659a30747e5feeac6cfec4208791370 100644
52+
index 90b158b84b..8d9f7c4096 100644
5353
--- a/src/node_builtins.h
5454
+++ b/src/node_builtins.h
5555
@@ -71,6 +71,7 @@ class NODE_EXTERN_PRIVATE BuiltinLoader {
@@ -61,7 +61,7 @@ index 90b158b84bb2a66781cf92f5b4c1a64f9e2ee651..8d9f7c409659a30747e5feeac6cfec42
6161

6262
std::vector<std::string> GetBuiltinIds();
6363
diff --git a/tools/js2c.py b/tools/js2c.py
64-
index ef24c4de0aaa2cd5f3c06e5bd8dd90de2b30ffcb..ece70a8d7a1fdca051d4b821ba114be54bd34e4e 100755
64+
index 54c7dfce36..7b99ae5e5e 100755
6565
--- a/tools/js2c.py
6666
+++ b/tools/js2c.py
6767
@@ -39,6 +39,8 @@ import codecs
@@ -113,7 +113,7 @@ index ef24c4de0aaa2cd5f3c06e5bd8dd90de2b30ffcb..ece70a8d7a1fdca051d4b821ba114be5
113113
if split[0] == 'deps':
114114
split = ['internal'] + split
115115
else: # `lib/**/*.js` so drop the 'lib' part
116-
@@ -142,23 +148,36 @@ def NormalizeFileName(filename):
116+
@@ -134,23 +140,36 @@ def NormalizeFileName(filename):
117117
return os.path.splitext(filename)[0]
118118

119119

@@ -159,22 +159,23 @@ index ef24c4de0aaa2cd5f3c06e5bd8dd90de2b30ffcb..ece70a8d7a1fdca051d4b821ba114be5
159159
write_if_chaged(out, target)
160160

161161

162-
@@ -218,6 +237,7 @@ def main():
162+
@@ -214,6 +233,7 @@ def main():
163163
default=None,
164-
help='input file directory')
164+
help='root directory containing the sources')
165165
parser.add_argument('--verbose', action='store_true', help='output file')
166166
+ parser.add_argument('--only-js', action='store_true', help='do not require or parse any config.gypi files')
167167
parser.add_argument('sources', nargs='*', help='input files')
168168
options = parser.parse_args()
169169
global is_verbose
170-
@@ -230,12 +250,15 @@ def main():
170+
@@ -230,13 +250,15 @@ def main():
171171

172172
source_files = functools.reduce(SourceFileByExt, sources, {})
173173

174174
- # Should have exactly 3 types: `.js`, `.mjs` and `.gypi`
175175
- assert len(source_files) == 3
176176
- # Currently config.gypi is the only `.gypi` file allowed
177-
- assert source_files['.gypi'] == ['config.gypi']
177+
- assert len(source_files['.gypi']) == 1
178+
- assert os.path.basename(source_files['.gypi'][0]) == 'config.gypi'
178179
- source_files['config.gypi'] = source_files.pop('.gypi')[0]
179180
- JS2C(source_files, options.target)
180181
+ if options.only_js:

0 commit comments

Comments
 (0)