@yao-pkg/pkg-fetch 3.5.6 → 3.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -50,14 +50,10 @@ This project deploys multiple defense measures to ensure that the safe binaries
50
50
 
51
51
  1. Clone Node.js as a sibling to your current `pkg-fetch` clone
52
52
 
53
- - `git clone https://github.com/nodejs/node.git`
54
- - `cd node`
53
+ - `git clone -b v18.13.0 --single-branch https://github.com/nodejs/node.git`
54
+ - `cd node`
55
55
 
56
- 2. Checkout the tag you wish to generate a patch for
57
-
58
- - `git checkout v18.13.0`
59
-
60
- 3. Attempt to apply the closest patch (e.g. applying the existing patch for
56
+ 2. Attempt to apply the closest patch (e.g. applying the existing patch for
61
57
  18.12.1 when trying to generate a new patch for 18.13.0)
62
58
 
63
59
  - `git apply ..\pkg-fetch\patches\node.v18.12.1.cpp.patch --reject`
@@ -1,5 +1,4 @@
1
1
  {
2
- "node-v10.24.1-alpine-arm64": "f6a59f1ace2ef1f4bf976ff85d9a74bdc71bda098e8aa018e2a089c590aeedea",
3
2
  "node-v14.21.3-alpine-arm64": "651c2b423925c9dab1ca7695acfb1462be13264f0c1fb6c8b472474c7dbacddd",
4
3
  "node-v14.21.3-alpine-x64": "4f2b5b16428f998302bbcf59ca229998be48e5dc6c2487edb603152651c182cd",
5
4
  "node-v14.21.3-linux-arm64": "bb20f63ac32c4e6a0545dfcea3833e8a8a968b95e91ce01cab7f4f48f1a56064",
@@ -22,26 +21,26 @@
22
21
  "node-v16.20.2-win-arm64": "7514915e02aedfbdc9f87ede04f1f251b014e312e3e184d5b94b42aeb28c2485",
23
22
  "node-v16.20.2-win-x64": "272729724993ce07b37d328718a0152e50ec5c9d27aa972975c09b75604c0dca",
24
23
  "node-v16.20.2-macos-arm64": "3d04eb7ddd8b614b888eeb1caa6e64a068b665ab4a26dd064051973ae5842a85",
25
- "node-v18.18.2-alpine-arm64": "244a74549a342ed74b531625c02168e1c0e72f328d8b8d53ab143a6813fd9466",
26
- "node-v18.18.2-alpine-x64": "b9c6d08f510ce15353d9f2441b5b096697c877b1760a6f526c203b47bf3ec83a",
27
- "node-v18.18.2-linux-arm64": "01676c5420d17a2fa53ddf4573ca21895150ae317cd54a7e26234c26d3603e7a",
28
- "node-v18.18.2-linux-x64": "d918fd7ad7d9db0cde09c570ada58a6fb9e2bf43c032a9cb87d0e572f06db646",
29
- "node-v18.18.2-linuxstatic-arm64": "2db35ca7c089fc78a8c6b44804a88aa1035344a7465b038f593cc337198285a6",
30
- "node-v18.18.2-linuxstatic-armv7": "705c75ab9155069ffb8c3f800f8d49121d2b0d07343e4da9a98477e2962602f9",
31
- "node-v18.18.2-linuxstatic-x64": "dce8f6c6f3ce48b4bbfb7a8177165c9743dba12458ccd42b9f3da3c9601fc088",
32
- "node-v18.18.2-macos-x64": "db04d8a9338e1d2f6afd53c99d0a57ec9cc4bca84165ade0d2f5fcf9871bcdb9",
33
- "node-v18.18.2-win-arm64": "ca08e24dfd5bae1a898d86f3241287e057c14e7fce37da1dff63f1bce6822b62",
34
- "node-v18.18.2-win-x64": "81b25a5dc71bb3ebc8219f4cd73ad598a1eaff16ccbb2f75cf8f5db94e08149b",
35
- "node-v18.18.2-macos-arm64": "35deec00661aa042d3557e74281c6742f0184e634da0df055c3c4214360a3070",
36
- "node-v19.8.1-alpine-arm64": "7d4fc8a17f116d6e77b6011201797897592fa03380e939fa8b49b00ba7ac641b",
37
- "node-v19.8.1-alpine-x64": "aca5632e1960d763c7b9914ebfeb929c4ca0e8c2112798eca3959ba9a5076ed8",
38
- "node-v19.8.1-linux-arm64": "4754c852da9e55591d7e54c4b9c5db1db4d52c8452b8533aab73451c1c5797f8",
39
- "node-v19.8.1-linux-x64": "757a9e3b8a72f6eecf5cbc0b8ec4b25298375c1952165c3ef2184133ac81ff44",
40
- "node-v19.8.1-linuxstatic-arm64": "46b343c2d948acdf36d1717ad3e4a0c1bf28ea1abf845e24ed4cbf4d047a0890",
41
- "node-v19.8.1-linuxstatic-armv7": "63c7154dee90dd6734cdf3eaa8ab3e1ab111772612eb48271f6cfd22f84c4dee",
42
- "node-v19.8.1-linuxstatic-x64": "39c5c208347c76d921212d7a0d885c0b54d8c698b01c0e1e4b167b87fbc6ffb1",
43
- "node-v19.8.1-macos-x64": "7288e53e6afe4d07bc5f32965ca7a051d7e72a67f09979c561dc8dabff88a5b2",
44
- "node-v19.8.1-win-arm64": "f288732fc5f5493367a5d60d1e227347099de3db26fd651607df07d37fb8222e",
45
- "node-v19.8.1-win-x64": "98b22116864d72e1ccb4d557dc36785cf731051543c5c876f1bf547872de2d1d",
46
- "node-v19.8.1-macos-arm64": "69c1113d1fbcce01e0062af12a4a1b81f6c3746ff32a8b307f8632788109c94a"
24
+ "node-v18.19.0-alpine-arm64": "718796065af7a231af2467760aa60ca1b71ddc8514e81cf00f157004de27fc17",
25
+ "node-v18.19.0-alpine-x64": "6d16ceb0a1e6df087de5189a896682c4747dfd9f169373c1da25639c991abd3b",
26
+ "node-v18.19.0-linux-arm64": "512d67139c488b8ff775da043cc1e2a721f1b8e745f98214fbf637c7fa7affcc",
27
+ "node-v18.19.0-linux-x64": "9e8c89d6214bdf5efaaf18c30026bc8779d536153639e5b0c420b68cb800775a",
28
+ "node-v18.19.0-linuxstatic-arm64": "9bc83f4ca62eb3501bf4c439720e87074eac73c3680785ea459037f4daa9ffdb",
29
+ "node-v18.19.0-linuxstatic-armv7": "2f36ce5a5e2536d7f14b2a2bcfe0d9907a653370c18586c75d3cb4b772639d65",
30
+ "node-v18.19.0-linuxstatic-x64": "c09d8c8975d3f6159ad188ff993cb9121ac0a79cde624a0ee68de79adc7534c7",
31
+ "node-v18.19.0-macos-arm64": "813ed0157bc126d23f0bf29af84384727a628ada4687fa22e1c8bb7877f7fb1f",
32
+ "node-v18.19.0-macos-x64": "b1309d883f4990850abe73fc94f18e00ed4102377c16bf998413faf90c6db6cd",
33
+ "node-v18.19.0-win-arm64": "69b6b8c7d2b6f57f03d6f995c1b87d1614f6a52d877d92065c86415c02779aa5",
34
+ "node-v18.19.0-win-x64": "33065fb87e5f5380c3bcf410c804a1447f80136118113ff95c346049c2437d9e",
35
+ "node-v20.11.0-alpine-arm64": "47ef05cd0ecd4b595b859851d2683356443544b73c6c2b8d851c99dbfe66c5a2",
36
+ "node-v20.11.0-alpine-x64": "12052931ee5f659e1b56f3357a7d55134d04a8bb75ad36d76ad993ef35dfea5b",
37
+ "node-v20.11.0-linux-arm64": "317e9546705f530abf27575a031a96ec5a4d1f888c2188419ac243bfec7bdbca",
38
+ "node-v20.11.0-linux-x64": "57cad53c1df2c7bf9d1e16175f64d227b6788ac1cc88c6a26cf4a3274f2e8867",
39
+ "node-v20.11.0-linuxstatic-arm64": "cfd092c23c743be0d00f6a87c20afe089586e5b242750c609ba319e7a6b90931",
40
+ "node-v20.11.0-linuxstatic-armv7": "8a25bf3d436a3523bb15fc58374774340766b7be95355d39ad7fe2a0d4a38f1b",
41
+ "node-v20.11.0-linuxstatic-x64": "5a06f4b4638412726a17b2f5b308667aaef9059c034341ba9025829efe8bdd03",
42
+ "node-v20.11.0-macos-arm64": "4db642c5cd55623bcb15c0af5885f2ea791b9e88b769e2c973a00118f4002a9b",
43
+ "node-v20.11.0-macos-x64": "d599428c706a749fe856d491c00dd7bdee88607a3fc572a774288dbff61f96ac",
44
+ "node-v20.11.0-win-arm64": "4f8bcac5cf5452af28658fccbd2a5ea41c1efcc0a1bbd0770d6a0ed50dfe3b64",
45
+ "node-v20.11.0-win-x64": "e0f7c52e40b2d7e41e97017fa1cb50835adf788da62fc2d6ef12b3266f071e7a"
47
46
  }
package/lib-es5/verify.js CHANGED
@@ -39,7 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.verify = void 0;
40
40
  var child_process_1 = require("child_process");
41
41
  var utils_1 = require("./utils");
42
- var script = "\n var vm = require('vm');\n var assert = require('assert');\n var text = '(function () { return 42; })';\n var cd, fn, result;\n var modules = process.versions.modules | 0;\n var v8 = process.versions.v8.split('.').slice(0, 2).join('.');\n\n var s1 = new vm.Script(text, { filename: 's1', produceCachedData: true, sourceless: true });\n assert(s1.cachedDataProduced);\n cd = s1.cachedData;\n\n var kCpuFeaturesOffset, cpuFeatures;\n\n if (modules === 14) {\n } else\n if (modules === 46 || modules === 48 || modules === 51) {\n kCpuFeaturesOffset = 0x0c;\n } else\n if (modules === 57) {\n if (v8 === '6.2') {\n kCpuFeaturesOffset = 0x0c;\n } else\n if (v8 === '5.8') {\n kCpuFeaturesOffset = 0x0c;\n } else {\n kCpuFeaturesOffset = 0x10;\n }\n } else\n if (modules === 59) {\n kCpuFeaturesOffset = 0x0c;\n } else\n if (modules === 64) {\n kCpuFeaturesOffset = 0x0c;\n } else\n if (modules === 72) {\n // no cpu features anymore\n } else\n if (modules === 79) {\n // no cpu features anymore\n } else\n if (modules === 83) {\n // no cpu features anymore\n } else\n if (modules === 93) {\n // no cpu features anymore\n } else\n if (modules === 108) {\n // no cpu features anymore\n } else\n if (modules === 111) {\n // no cpu features anymore\n } else {\n assert(false, modules);\n }\n\n if (modules >= 46 && // no cpu_features field in 0.12\n process.arch !== 'arm' && // non-zero features even in sourceless mode in arm\n modules < 72) { // no cpu_features field in 12+\n cpuFeatures = cd.readUInt32LE(kCpuFeaturesOffset);\n assert(cpuFeatures === 0, 'CPU_FEATURES must be zero');\n }\n\n var s2 = new vm.Script(undefined, { filename: 's2', cachedData: cd, sourceless: true });\n fn = s2.runInThisContext();\n result = fn();\n assert.equal(result, 42);\n\n if (modules === 14) {\n } else\n if (modules === 46 || modules === 48 ||\n modules === 51 || modules === 57 || modules === 59 || modules === 64) {\n var paddedPayloadOffset = 0x48; // see SerializedCodeData::Payload()\n var index = paddedPayloadOffset + 10;\n cd[index] ^= 0xf0;\n var s3 = new vm.Script(undefined, { filename: 's3', cachedData: cd, sourceless: true });\n assert(s3.cachedDataRejected, 's3.cachedDataRejected must be true');\n } else\n if (modules === 72) {\n } else\n if (modules === 79) {\n } else\n if (modules === 83) {\n } else\n if (modules === 93) {\n } else\n if (modules === 108) {\n } else\n if (modules === 111) {\n } else {\n assert(false, modules);\n }\n\n var s4 = new vm.Script(text, { filename: 's4', produceCachedData: true });\n assert(s4.cachedDataProduced, 's4.cachedDataProduced must be true');\n cd = s4.cachedData;\n\n if (modules >= 46 && // no cpu_features field in 0.12\n process.arch !== 'arm' && // zero features even in non-sourceless mode in arm\n modules < 72) { // no cpu_features field in 12+\n cpuFeatures = cd.readUInt32LE(kCpuFeaturesOffset);\n assert(cpuFeatures !== 0, 'CPU_FEATURES must be non-zero');\n }\n\n console.log('ok');\n";
42
+ var script = "\n var vm = require('vm');\n var assert = require('assert');\n var text = '(function () { return 42; })';\n var cd, fn, result;\n var modules = process.versions.modules | 0;\n var v8 = process.versions.v8.split('.').slice(0, 2).join('.');\n\n var s1 = new vm.Script(text, { filename: 's1', produceCachedData: true, sourceless: true });\n assert(s1.cachedDataProduced);\n cd = s1.cachedData;\n\n var kCpuFeaturesOffset, cpuFeatures;\n\n if (modules === 14) {\n } else\n if (modules === 46 || modules === 48 || modules === 51) {\n kCpuFeaturesOffset = 0x0c;\n } else\n if (modules === 57) {\n if (v8 === '6.2') {\n kCpuFeaturesOffset = 0x0c;\n } else\n if (v8 === '5.8') {\n kCpuFeaturesOffset = 0x0c;\n } else {\n kCpuFeaturesOffset = 0x10;\n }\n } else\n if (modules === 59) {\n kCpuFeaturesOffset = 0x0c;\n } else\n if (modules === 64) {\n kCpuFeaturesOffset = 0x0c;\n } else\n if (modules === 72) {\n // no cpu features anymore\n } else\n if (modules === 79) {\n // no cpu features anymore\n } else\n if (modules === 83) {\n // no cpu features anymore\n } else\n if (modules === 93) {\n // no cpu features anymore\n } else\n if (modules === 108) {\n // no cpu features anymore\n } else\n if (modules === 111) {\n // no cpu features anymore\n } else\n if (modules === 115) {\n // no cpu features anymore\n } else {\n assert(false, modules);\n }\n\n if (modules >= 46 && // no cpu_features field in 0.12\n process.arch !== 'arm' && // non-zero features even in sourceless mode in arm\n modules < 72) { // no cpu_features field in 12+\n cpuFeatures = cd.readUInt32LE(kCpuFeaturesOffset);\n assert(cpuFeatures === 0, 'CPU_FEATURES must be zero');\n }\n\n var s2 = new vm.Script(undefined, { filename: 's2', cachedData: cd, sourceless: true });\n fn = s2.runInThisContext();\n result = fn();\n assert.equal(result, 42);\n\n if (modules === 14) {\n } else\n if (modules === 46 || modules === 48 ||\n modules === 51 || modules === 57 || modules === 59 || modules === 64) {\n var paddedPayloadOffset = 0x48; // see SerializedCodeData::Payload()\n var index = paddedPayloadOffset + 10;\n cd[index] ^= 0xf0;\n var s3 = new vm.Script(undefined, { filename: 's3', cachedData: cd, sourceless: true });\n assert(s3.cachedDataRejected, 's3.cachedDataRejected must be true');\n } else\n if (modules === 72) {\n } else\n if (modules === 79) {\n } else\n if (modules === 83) {\n } else\n if (modules === 93) {\n } else\n if (modules === 108) {\n } else\n if (modules === 111) {\n } else\n if (modules === 115) {\n } else {\n assert(false, modules);\n }\n\n var s4 = new vm.Script(text, { filename: 's4', produceCachedData: true });\n assert(s4.cachedDataProduced, 's4.cachedDataProduced must be true');\n cd = s4.cachedData;\n\n if (modules >= 46 && // no cpu_features field in 0.12\n process.arch !== 'arm' && // zero features even in non-sourceless mode in arm\n modules < 72) { // no cpu_features field in 12+\n cpuFeatures = cd.readUInt32LE(kCpuFeaturesOffset);\n assert(cpuFeatures !== 0, 'CPU_FEATURES must be non-zero');\n }\n\n console.log('ok');\n";
43
43
  function verify(local) {
44
44
  return __awaiter(this, void 0, void 0, function () {
45
45
  return __generator(this, function (_a) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yao-pkg/pkg-fetch",
3
- "version": "3.5.6",
3
+ "version": "3.5.8",
4
4
  "description": "Compiles and stores base binaries for pkg",
5
5
  "main": "lib-es5/index.js",
6
6
  "license": "MIT",
@@ -307,7 +307,7 @@ index de409a31f3..d26e4366ad 100644
307
307
 
308
308
  'conditions': [
309
309
  + ['target_arch=="arm64"', {
310
- + 'cflags': ['-msign-return-address=all'], # Pointer authentication.
310
+ + 'cflags': ['-mbranch-protection=standard'], # Pointer authentication.
311
311
  + }],
312
312
  ['OS=="aix"', {
313
313
  'ldflags': [
@@ -1,5 +1,5 @@
1
1
  diff --git node/common.gypi node/common.gypi
2
- index 94fae06518..e4116f3c82 100644
2
+ index dba2631f21..4c4c430dc1 100644
3
3
  --- node/common.gypi
4
4
  +++ node/common.gypi
5
5
  @@ -174,7 +174,7 @@
@@ -12,7 +12,7 @@ index 94fae06518..e4116f3c82 100644
12
12
  'lto': ' -flto ', # Clang
13
13
  }],
14
14
  diff --git node/configure.py node/configure.py
15
- index 7006ee6581..12fb2ac8d1 100755
15
+ index 4638f04b6a..ffa1c6338a 100755
16
16
  --- node/configure.py
17
17
  +++ node/configure.py
18
18
  @@ -1289,9 +1289,7 @@ def configure_node(o):
@@ -169,7 +169,7 @@ index 618cf9e975..64a57e8afe 100644
169
169
  uint32_t max_payload_length = this->size_ - kHeaderSize;
170
170
  if (payload_length > max_payload_length) {
171
171
  diff --git node/lib/child_process.js node/lib/child_process.js
172
- index 5bdc474c80..196778e7db 100644
172
+ index 449013906e..3a85e4a541 100644
173
173
  --- node/lib/child_process.js
174
174
  +++ node/lib/child_process.js
175
175
  @@ -169,7 +169,7 @@ function fork(modulePath, args = [], options) {
@@ -237,59 +237,144 @@ index 0000000000..a697294fdf
237
237
  + }());
238
238
  +}());
239
239
  diff --git node/lib/internal/modules/cjs/loader.js node/lib/internal/modules/cjs/loader.js
240
- index 88bb870a8f..22bbdd9058 100644
240
+ index 316996a8c3..8cd0727556 100644
241
241
  --- node/lib/internal/modules/cjs/loader.js
242
242
  +++ node/lib/internal/modules/cjs/loader.js
243
- @@ -94,7 +94,7 @@ const fs = require('fs');
244
- const internalFS = require('internal/fs/utils');
243
+ @@ -89,7 +89,7 @@ const { internalCompileFunction } = require('internal/vm');
244
+ const assert = require('internal/assert');
245
+ const fs = require('fs');
245
246
  const path = require('path');
246
- const { sep } = path;
247
247
  -const { internalModuleStat } = internalBinding('fs');
248
248
  +const internalModuleStat = function (f) { return require('fs').internalModuleStat(f); };
249
- const packageJsonReader = require('internal/modules/package_json_reader');
250
249
  const { safeGetenv } = internalBinding('credentials');
251
250
  const {
251
+ privateSymbols: {
252
252
  diff --git node/lib/internal/modules/package_json_reader.js node/lib/internal/modules/package_json_reader.js
253
- index bb175d0df5..07f4834c07 100644
253
+ index 1968960576..d73016f3fe 100644
254
254
  --- node/lib/internal/modules/package_json_reader.js
255
255
  +++ node/lib/internal/modules/package_json_reader.js
256
- @@ -1,7 +1,7 @@
257
- 'use strict';
258
-
259
- const { SafeMap } = primordials;
256
+ @@ -12,7 +12,7 @@ const {
257
+ const {
258
+ ERR_INVALID_PACKAGE_CONFIG,
259
+ } = require('internal/errors').codes;
260
260
  -const { internalModuleReadJSON } = internalBinding('fs');
261
261
  +const internalModuleReadJSON = function (f) { return require('fs').internalModuleReadJSON(f); };
262
- const { pathToFileURL } = require('url');
263
- const { toNamespacedPath } = require('path');
262
+ const { resolve, sep, toNamespacedPath } = require('path');
263
+ const { kEmptyObject } = require('internal/util');
264
264
 
265
265
  diff --git node/lib/internal/process/pre_execution.js node/lib/internal/process/pre_execution.js
266
- index b4a24bbffb..041ee4c715 100644
266
+ index 4795be82e7..977124a014 100644
267
267
  --- node/lib/internal/process/pre_execution.js
268
268
  +++ node/lib/internal/process/pre_execution.js
269
- @@ -36,7 +36,12 @@ const {
270
- isBuildingSnapshot,
271
- } = require('v8').startupSnapshot;
269
+ @@ -36,7 +36,11 @@ const {
270
+ },
271
+ } = require('internal/v8/startup_snapshot');
272
272
 
273
273
  +let _alreadyPrepared = false;
274
274
  +
275
275
  function prepareMainThreadExecution(expandArgv1 = false, initializeModules = true) {
276
276
  + if (_alreadyPrepared === true) return;
277
277
  + _alreadyPrepared = true;
278
- +
279
- prepareExecution({
278
+ return prepareExecution({
280
279
  expandArgv1,
281
280
  initializeModules,
282
- @@ -155,7 +160,8 @@ function patchProcessObject(expandArgv1) {
283
- process.argv[0] = process.execPath;
284
-
281
+ @@ -191,7 +195,8 @@ function patchProcessObject(expandArgv1) {
282
+ // If requested, update process.argv[1] to replace whatever the user provided with the resolved absolute file path of
283
+ // the entry point.
285
284
  if (expandArgv1 && process.argv[1] &&
286
285
  - !StringPrototypeStartsWith(process.argv[1], '-')) {
287
- + !StringPrototypeStartsWith(process.argv[1], '-') &&
288
- + process.argv[1] !== 'PKG_DUMMY_ENTRYPOINT') {
286
+ + !StringPrototypeStartsWith(process.argv[1], '-') &&
287
+ + process.argv[1] !== 'PKG_DUMMY_ENTRYPOINT') {
289
288
  // Expand process.argv[1] into a full path.
290
289
  const path = require('path');
291
290
  try {
292
- @@ -603,6 +609,7 @@ function loadPreloadModules() {
291
+ @@ -263,7 +268,7 @@ function setupWarningHandler() {
292
+ // https://fetch.spec.whatwg.org/
293
+ function setupFetch() {
294
+ if (process.config.variables.node_no_browser_globals ||
295
+ - getOptionValue('--no-experimental-fetch')) {
296
+ + getOptionValue('--no-experimental-fetch')) {
297
+ return;
298
+ }
299
+
300
+ @@ -313,7 +318,7 @@ function setupFetch() {
301
+ // removed.
302
+ function setupWebCrypto() {
303
+ if (process.config.variables.node_no_browser_globals ||
304
+ - !getOptionValue('--experimental-global-webcrypto')) {
305
+ + !getOptionValue('--experimental-global-webcrypto')) {
306
+ return;
307
+ }
308
+
309
+ @@ -335,7 +340,7 @@ function setupCodeCoverage() {
310
+ // --experimental-test-coverage flag is present, as the test runner will
311
+ // handle coverage.
312
+ if (process.env.NODE_V8_COVERAGE &&
313
+ - !getOptionValue('--experimental-test-coverage')) {
314
+ + !getOptionValue('--experimental-test-coverage')) {
315
+ process.env.NODE_V8_COVERAGE =
316
+ setupCoverageHooks(process.env.NODE_V8_COVERAGE);
317
+ }
318
+ @@ -345,7 +350,7 @@ function setupCodeCoverage() {
319
+ // removed.
320
+ function setupCustomEvent() {
321
+ if (process.config.variables.node_no_browser_globals ||
322
+ - !getOptionValue('--experimental-global-customevent')) {
323
+ + !getOptionValue('--experimental-global-customevent')) {
324
+ return;
325
+ }
326
+ const { CustomEvent } = require('internal/event_target');
327
+ @@ -468,10 +473,10 @@ function initializeDeprecations() {
328
+ ]) {
329
+ utilBinding[name] = pendingDeprecation ?
330
+ deprecate(types[name],
331
+ - 'Accessing native typechecking bindings of Node ' +
332
+ - 'directly is deprecated. ' +
333
+ - `Please use \`util.types.${name}\` instead.`,
334
+ - 'DEP0103') :
335
+ + 'Accessing native typechecking bindings of Node ' +
336
+ + 'directly is deprecated. ' +
337
+ + `Please use \`util.types.${name}\` instead.`,
338
+ + 'DEP0103') :
339
+ types[name];
340
+ }
341
+
342
+ @@ -492,12 +497,12 @@ function initializeDeprecations() {
343
+
344
+ if (pendingDeprecation) {
345
+ process.binding = deprecate(process.binding,
346
+ - 'process.binding() is deprecated. ' +
347
+ - 'Please use public APIs instead.', 'DEP0111');
348
+ + 'process.binding() is deprecated. ' +
349
+ + 'Please use public APIs instead.', 'DEP0111');
350
+
351
+ process._tickCallback = deprecate(process._tickCallback,
352
+ - 'process._tickCallback() is deprecated',
353
+ - 'DEP0134');
354
+ + 'process._tickCallback() is deprecated',
355
+ + 'DEP0134');
356
+ }
357
+ }
358
+
359
+ @@ -533,7 +538,7 @@ function readPolicyFromDisk() {
360
+ const experimentalPolicy = getOptionValue('--experimental-policy');
361
+ if (experimentalPolicy) {
362
+ process.emitWarning('Policies are experimental.',
363
+ - 'ExperimentalWarning');
364
+ + 'ExperimentalWarning');
365
+ const { pathToFileURL, URL } = require('internal/url');
366
+ // URL here as it is slightly different parsing
367
+ // no bare specifiers for now
368
+ @@ -611,7 +616,7 @@ function initializeSourceMapsHandlers() {
369
+ function initializeFrozenIntrinsics() {
370
+ if (getOptionValue('--frozen-intrinsics')) {
371
+ process.emitWarning('The --frozen-intrinsics flag is experimental',
372
+ - 'ExperimentalWarning');
373
+ + 'ExperimentalWarning');
374
+ require('internal/freeze_intrinsics')();
375
+ }
376
+ }
377
+ @@ -620,6 +625,7 @@ function loadPreloadModules() {
293
378
  // For user code, we preload modules if `-r` is passed
294
379
  const preloadModules = getOptionValue('--require');
295
380
  if (preloadModules && preloadModules.length > 0) {
@@ -298,7 +383,7 @@ index b4a24bbffb..041ee4c715 100644
298
383
  Module: {
299
384
  _preloadModules,
300
385
  diff --git node/lib/vm.js node/lib/vm.js
301
- index 21acc55e2e..8a128bcb5c 100644
386
+ index b48e79c282..3b86fa8933 100644
302
387
  --- node/lib/vm.js
303
388
  +++ node/lib/vm.js
304
389
  @@ -77,6 +77,7 @@ class Script extends ContextifyScript {
@@ -320,10 +405,10 @@ index 21acc55e2e..8a128bcb5c 100644
320
405
  throw e; /* node-do-not-add-exception-line */
321
406
  }
322
407
  diff --git node/node.gyp node/node.gyp
323
- index 6b554d75d8..fce4eb4bd5 100644
408
+ index 08cb3f38e8..6c0d2761ab 100644
324
409
  --- node/node.gyp
325
410
  +++ node/node.gyp
326
- @@ -113,6 +113,9 @@
411
+ @@ -116,6 +116,9 @@
327
412
  },
328
413
 
329
414
  'conditions': [
@@ -347,10 +432,10 @@ index b1ba86b7b0..e2478e537c 100644
347
432
  parent_env_->AddCleanupHook([](void* data) {
348
433
  Environment* env = static_cast<Environment*>(data);
349
434
  diff --git node/src/node.cc node/src/node.cc
350
- index 96cdcd3064..cef0838d53 100644
435
+ index 0c75b5a08e..385a03090f 100644
351
436
  --- node/src/node.cc
352
437
  +++ node/src/node.cc
353
- @@ -314,6 +314,8 @@ MaybeLocal<Value> StartExecution(Environment* env, StartExecutionCallback cb) {
438
+ @@ -304,6 +304,8 @@ MaybeLocal<Value> StartExecution(Environment* env, StartExecutionCallback cb) {
354
439
  return env->RunSnapshotDeserializeMain();
355
440
  }
356
441
 
@@ -359,7 +444,7 @@ index 96cdcd3064..cef0838d53 100644
359
444
  if (env->worker_context() != nullptr) {
360
445
  return StartExecution(env, "internal/main/worker_thread");
361
446
  }
362
- @@ -546,14 +548,6 @@ static void PlatformInit(ProcessInitializationFlags::Flags flags) {
447
+ @@ -536,14 +538,6 @@ static void PlatformInit(ProcessInitializationFlags::Flags flags) {
363
448
  }
364
449
 
365
450
  if (!(flags & ProcessInitializationFlags::kNoDefaultSignalHandling)) {
@@ -555,10 +640,10 @@ index 8099b2a3a1..9cc8a07a55 100644
555
640
  + return adjacent(c, nargv);
556
641
  +}
557
642
  diff --git node/src/node_options.cc node/src/node_options.cc
558
- index 26f205bc3b..e52a31f487 100644
643
+ index 6ee79f7df8..cfc3e8d785 100644
559
644
  --- node/src/node_options.cc
560
645
  +++ node/src/node_options.cc
561
- @@ -307,7 +307,7 @@ DebugOptionsParser::DebugOptionsParser() {
646
+ @@ -314,7 +314,7 @@ DebugOptionsParser::DebugOptionsParser() {
562
647
  #ifndef DISABLE_SINGLE_EXECUTABLE_APPLICATION
563
648
  if (sea::IsSingleExecutable()) return;
564
649
  #endif
@@ -1,8 +1,8 @@
1
1
  diff --git node/common.gypi node/common.gypi
2
- index b1d87780db..659da7c790 100644
2
+ index db09a8a33d..6b2053467d 100644
3
3
  --- node/common.gypi
4
4
  +++ node/common.gypi
5
- @@ -174,7 +174,7 @@
5
+ @@ -182,7 +182,7 @@
6
6
  'MSVC_runtimeType': 2 # MultiThreadedDLL (/MD)
7
7
  }],
8
8
  ['llvm_version=="0.0"', {
@@ -12,14 +12,12 @@ index b1d87780db..659da7c790 100644
12
12
  'lto': ' -flto ', # Clang
13
13
  }],
14
14
  diff --git node/configure.py node/configure.py
15
- index d7765ef6bd..3c15a61215 100755
15
+ index 84b016cd85..3b31b09f04 100755
16
16
  --- node/configure.py
17
17
  +++ node/configure.py
18
- @@ -1265,9 +1265,7 @@ def configure_node(o):
18
+ @@ -1275,7 +1275,6 @@ def configure_node(o):
19
19
 
20
- o['variables']['want_separate_host_toolset'] = int(cross_compiling)
21
-
22
- - # Enable branch protection for arm64
20
+ # Enable branch protection for arm64
23
21
  if target_arch == 'arm64':
24
22
  - o['cflags']+=['-msign-return-address=all']
25
23
  o['variables']['arm_fpu'] = options.arm_fpu or 'neon'
@@ -41,10 +39,10 @@ index d3e35d6ec5..6e9bbe3849 100644
41
39
  static const char* GetVersion();
42
40
 
43
41
  diff --git node/deps/v8/src/api/api.cc node/deps/v8/src/api/api.cc
44
- index a4a4381614..2998f3c49b 100644
42
+ index a91dfc271c..a4cd4eeb31 100644
45
43
  --- node/deps/v8/src/api/api.cc
46
44
  +++ node/deps/v8/src/api/api.cc
47
- @@ -683,6 +683,29 @@ void V8::SetFlagsFromCommandLine(int* argc, char** argv, bool remove_flags) {
45
+ @@ -806,6 +806,28 @@ void V8::SetFlagsFromCommandLine(int* argc, char** argv, bool remove_flags) {
48
46
  HelpOptions(HelpOptions::kDontExit));
49
47
  }
50
48
 
@@ -52,21 +50,20 @@ index a4a4381614..2998f3c49b 100644
52
50
  +bool save_predictable;
53
51
  +
54
52
  +void V8::EnableCompilationForSourcelessUse() {
55
- + save_lazy = i::FLAG_lazy;
56
- + i::FLAG_lazy = false;
57
- + save_predictable = i::FLAG_predictable;
58
- + i::FLAG_predictable = true;
53
+ + save_lazy = i::v8_flags.lazy;
54
+ + i::v8_flags.lazy = false;
55
+ + save_predictable = i::v8_flags.predictable;
56
+ + i::v8_flags.predictable = true;
59
57
  +}
60
58
  +
61
59
  +void V8::DisableCompilationForSourcelessUse() {
62
- + i::FLAG_lazy = save_lazy;
63
- + i::FLAG_predictable = save_predictable;
60
+ + i::v8_flags.lazy = save_lazy;
61
+ + i::v8_flags.predictable = save_predictable;
64
62
  +}
65
63
  +
66
64
  +void V8::FixSourcelessScript(Isolate* v8_isolate, Local<UnboundScript> unbound_script) {
67
65
  + auto isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
68
- + auto function_info =
69
- + i::Handle<i::SharedFunctionInfo>::cast(Utils::OpenHandle(*unbound_script));
66
+ + auto function_info = i::Handle<i::SharedFunctionInfo>::cast(Utils::OpenHandle(*unbound_script));
70
67
  + i::Handle<i::Script> script(i::Script::cast(function_info->script()), isolate);
71
68
  + script->set_source(i::ReadOnlyRoots(isolate).undefined_value());
72
69
  +}
@@ -75,10 +72,10 @@ index a4a4381614..2998f3c49b 100644
75
72
 
76
73
  RegisteredExtension::RegisteredExtension(std::unique_ptr<Extension> extension)
77
74
  diff --git node/deps/v8/src/codegen/compiler.cc node/deps/v8/src/codegen/compiler.cc
78
- index 5431deb83e..d11f04ccac 100644
75
+ index 31c5acceeb..56cad8671f 100644
79
76
  --- node/deps/v8/src/codegen/compiler.cc
80
77
  +++ node/deps/v8/src/codegen/compiler.cc
81
- @@ -3497,7 +3497,7 @@ MaybeHandle<SharedFunctionInfo> GetSharedFunctionInfoForScriptImpl(
78
+ @@ -3475,7 +3475,7 @@ MaybeHandle<SharedFunctionInfo> GetSharedFunctionInfoForScriptImpl(
82
79
  maybe_script = lookup_result.script();
83
80
  maybe_result = lookup_result.toplevel_sfi();
84
81
  is_compiled_scope = lookup_result.is_compiled_scope();
@@ -88,24 +85,24 @@ index 5431deb83e..d11f04ccac 100644
88
85
  } else if (can_consume_code_cache) {
89
86
  compile_timer.set_consuming_code_cache();
90
87
  diff --git node/deps/v8/src/objects/js-function.cc node/deps/v8/src/objects/js-function.cc
91
- index 62fe309a47..f1875ce023 100644
88
+ index 94f7a672a7..57bb3fc7f1 100644
92
89
  --- node/deps/v8/src/objects/js-function.cc
93
90
  +++ node/deps/v8/src/objects/js-function.cc
94
- @@ -1245,6 +1245,9 @@ Handle<String> JSFunction::ToString(Handle<JSFunction> function) {
95
- Handle<Object> maybe_class_positions = JSReceiver::GetDataProperty(
96
- isolate, function, isolate->factory()->class_positions_symbol());
97
- if (maybe_class_positions->IsClassPositions()) {
98
- + if (String::cast(Script::cast(shared_info->script()).source()).IsUndefined(isolate)) {
99
- + return isolate->factory()->NewStringFromAsciiChecked("class {}");
100
- + }
101
- ClassPositions class_positions =
102
- ClassPositions::cast(*maybe_class_positions);
103
- int start_position = class_positions.start();
91
+ @@ -1280,6 +1280,9 @@ Handle<String> JSFunction::ToString(Handle<JSFunction> function) {
92
+ Handle<Object> maybe_class_positions = JSReceiver::GetDataProperty(
93
+ isolate, function, isolate->factory()->class_positions_symbol());
94
+ if (maybe_class_positions->IsClassPositions()) {
95
+ + if (String::cast(Script::cast(shared_info->script()).source()).IsUndefined(isolate)) {
96
+ + return isolate->factory()->NewStringFromAsciiChecked("class {}");
97
+ + }
98
+ ClassPositions class_positions =
99
+ ClassPositions::cast(*maybe_class_positions);
100
+ int start_position = class_positions.start();
104
101
  diff --git node/deps/v8/src/objects/shared-function-info-inl.h node/deps/v8/src/objects/shared-function-info-inl.h
105
- index 43ef0d3d17..79b774463f 100644
102
+ index 5621b15d98..722e1d18cb 100644
106
103
  --- node/deps/v8/src/objects/shared-function-info-inl.h
107
104
  +++ node/deps/v8/src/objects/shared-function-info-inl.h
108
- @@ -637,6 +637,14 @@ bool SharedFunctionInfo::ShouldFlushCode(
105
+ @@ -635,6 +635,14 @@ bool SharedFunctionInfo::ShouldFlushCode(
109
106
  }
110
107
  if (!data.IsBytecodeArray()) return false;
111
108
 
@@ -141,23 +138,21 @@ index 8c55a6fb6e..70bf82a57d 100644
141
138
  std::unique_ptr<Utf16CharacterStream> stream(
142
139
  ScannerStream::For(isolate, source, shared_info->StartPosition(),
143
140
  diff --git node/deps/v8/src/snapshot/code-serializer.cc node/deps/v8/src/snapshot/code-serializer.cc
144
- index 95352299f8..2dd794b855 100644
141
+ index c83e8e4581..8cb451e147 100644
145
142
  --- node/deps/v8/src/snapshot/code-serializer.cc
146
143
  +++ node/deps/v8/src/snapshot/code-serializer.cc
147
- @@ -661,11 +661,7 @@ SerializedCodeSanityCheckResult SerializedCodeData::SanityCheck(
148
- }
144
+ @@ -659,10 +659,6 @@ SerializedCodeSanityCheckResult SerializedCodeData::SanityCheck(
149
145
 
150
146
  SerializedCodeSanityCheckResult SerializedCodeData::SanityCheckJustSource(
151
- - uint32_t expected_source_hash) const {
147
+ uint32_t expected_source_hash) const {
152
148
  - uint32_t source_hash = GetHeaderValue(kSourceHashOffset);
153
149
  - if (source_hash != expected_source_hash) {
154
150
  - return SerializedCodeSanityCheckResult::kSourceMismatch;
155
151
  - }
156
- + uint32_t) const {
157
152
  return SerializedCodeSanityCheckResult::kSuccess;
158
153
  }
159
154
 
160
- @@ -682,10 +678,6 @@ SerializedCodeSanityCheckResult SerializedCodeData::SanityCheckWithoutSource()
155
+ @@ -679,10 +675,6 @@ SerializedCodeSanityCheckResult SerializedCodeData::SanityCheckWithoutSource()
161
156
  if (version_hash != Version::Hash()) {
162
157
  return SerializedCodeSanityCheckResult::kVersionMismatch;
163
158
  }
@@ -169,10 +164,10 @@ index 95352299f8..2dd794b855 100644
169
164
  uint32_t max_payload_length = this->size_ - kHeaderSize;
170
165
  if (payload_length > max_payload_length) {
171
166
  diff --git node/lib/child_process.js node/lib/child_process.js
172
- index 5d3e2d63a7..077b96a415 100644
167
+ index 449013906e..3a85e4a541 100644
173
168
  --- node/lib/child_process.js
174
169
  +++ node/lib/child_process.js
175
- @@ -167,7 +167,7 @@ function fork(modulePath, args = [], options) {
170
+ @@ -169,7 +169,7 @@ function fork(modulePath, args = [], options) {
176
171
  throw new ERR_CHILD_PROCESS_IPC_REQUIRED('options.stdio');
177
172
  }
178
173
 
@@ -183,7 +178,7 @@ index 5d3e2d63a7..077b96a415 100644
183
178
  function _forkChild(fd, serializationMode) {
184
179
  diff --git node/lib/internal/bootstrap/pkg.js node/lib/internal/bootstrap/pkg.js
185
180
  new file mode 100644
186
- index 0000000000..e97e9e524c
181
+ index 0000000000..a697294fdf
187
182
  --- /dev/null
188
183
  +++ node/lib/internal/bootstrap/pkg.js
189
184
  @@ -0,0 +1,49 @@
@@ -237,36 +232,36 @@ index 0000000000..e97e9e524c
237
232
  + }());
238
233
  +}());
239
234
  diff --git node/lib/internal/modules/cjs/loader.js node/lib/internal/modules/cjs/loader.js
240
- index de83c69a70..f998e5a168 100644
235
+ index b077ee386b..b4271b5951 100644
241
236
  --- node/lib/internal/modules/cjs/loader.js
242
237
  +++ node/lib/internal/modules/cjs/loader.js
243
- @@ -94,7 +94,7 @@ const fs = require('fs');
244
- const internalFS = require('internal/fs/utils');
238
+ @@ -95,7 +95,7 @@ const { containsModuleSyntax } = internalBinding('contextify');
239
+ const assert = require('internal/assert');
240
+ const fs = require('fs');
245
241
  const path = require('path');
246
- const { sep } = path;
247
242
  -const { internalModuleStat } = internalBinding('fs');
248
- +const internalModuleStat = function (f) { return require('fs').internalModuleStat(f); };
243
+ +const internalModuleStat = function (f) { return require('fs').internalModuleStat(f); }
249
244
  const { safeGetenv } = internalBinding('credentials');
250
245
  const {
251
246
  privateSymbols: {
252
247
  diff --git node/lib/internal/modules/package_json_reader.js node/lib/internal/modules/package_json_reader.js
253
- index bb175d0df5..07f4834c07 100644
248
+ index 88c079d10d..a7eaca0574 100644
254
249
  --- node/lib/internal/modules/package_json_reader.js
255
250
  +++ node/lib/internal/modules/package_json_reader.js
256
- @@ -1,7 +1,7 @@
257
- 'use strict';
258
-
259
- const { SafeMap } = primordials;
251
+ @@ -12,7 +12,7 @@ const {
252
+ const {
253
+ ERR_INVALID_PACKAGE_CONFIG,
254
+ } = require('internal/errors').codes;
260
255
  -const { internalModuleReadJSON } = internalBinding('fs');
261
- +const internalModuleReadJSON = function (f) { return require('fs').internalModuleReadJSON(f); };
262
- const { pathToFileURL } = require('url');
263
- const { toNamespacedPath } = require('path');
264
-
256
+ +const internalModuleReadJSON = function (f) { return require('fs').internalModuleReadJSON(f); }
257
+ const { resolve, sep, toNamespacedPath } = require('path');
258
+ const permission = require('internal/process/permission');
259
+ const { kEmptyObject } = require('internal/util');
265
260
  diff --git node/lib/internal/process/pre_execution.js node/lib/internal/process/pre_execution.js
266
- index ebc699ef1d..f109969a94 100644
261
+ index 9142fed75e..557627919e 100644
267
262
  --- node/lib/internal/process/pre_execution.js
268
263
  +++ node/lib/internal/process/pre_execution.js
269
- @@ -36,7 +36,12 @@ const {
264
+ @@ -51,7 +51,11 @@ const {
270
265
  },
271
266
  } = require('internal/v8/startup_snapshot');
272
267
 
@@ -275,21 +270,20 @@ index ebc699ef1d..f109969a94 100644
275
270
  function prepareMainThreadExecution(expandArgv1 = false, initializeModules = true) {
276
271
  + if (_alreadyPrepared === true) return;
277
272
  + _alreadyPrepared = true;
278
- +
279
- prepareExecution({
273
+ return prepareExecution({
280
274
  expandArgv1,
281
275
  initializeModules,
282
- @@ -147,7 +152,8 @@ function patchProcessObject(expandArgv1) {
283
- process.argv[0] = process.execPath;
284
-
276
+ @@ -230,7 +234,8 @@ function patchProcessObject(expandArgv1) {
277
+ // If requested, update process.argv[1] to replace whatever the user provided with the resolved absolute file path of
278
+ // the entry point.
285
279
  if (expandArgv1 && process.argv[1] &&
286
280
  - !StringPrototypeStartsWith(process.argv[1], '-')) {
287
- + !StringPrototypeStartsWith(process.argv[1], '-') &&
288
- + process.argv[1] !== 'PKG_DUMMY_ENTRYPOINT') {
281
+ + !StringPrototypeStartsWith(process.argv[1], '-') &&
282
+ + process.argv[1] !== 'PKG_DUMMY_ENTRYPOINT') {
289
283
  // Expand process.argv[1] into a full path.
290
284
  const path = require('path');
291
285
  try {
292
- @@ -597,6 +603,7 @@ function loadPreloadModules() {
286
+ @@ -744,6 +749,7 @@ function loadPreloadModules() {
293
287
  // For user code, we preload modules if `-r` is passed
294
288
  const preloadModules = getOptionValue('--require');
295
289
  if (preloadModules && preloadModules.length > 0) {
@@ -298,10 +292,10 @@ index ebc699ef1d..f109969a94 100644
298
292
  Module: {
299
293
  _preloadModules,
300
294
  diff --git node/lib/vm.js node/lib/vm.js
301
- index 19117bca5d..94a21205f1 100644
295
+ index 44861be46d..9775ef58b7 100644
302
296
  --- node/lib/vm.js
303
297
  +++ node/lib/vm.js
304
- @@ -79,6 +79,7 @@ class Script extends ContextifyScript {
298
+ @@ -80,6 +80,7 @@ class Script extends ContextifyScript {
305
299
  produceCachedData = false,
306
300
  importModuleDynamically,
307
301
  [kParsingContext]: parsingContext,
@@ -310,34 +304,20 @@ index 19117bca5d..94a21205f1 100644
310
304
 
311
305
  validateString(filename, 'options.filename');
312
306
  @@ -103,7 +104,8 @@ class Script extends ContextifyScript {
313
- columnOffset,
314
307
  cachedData,
315
308
  produceCachedData,
316
- - parsingContext);
317
- + parsingContext,
309
+ parsingContext,
310
+ - hostDefinedOptionId);
311
+ + hostDefinedOptionId,
318
312
  + sourceless);
319
313
  } catch (e) {
320
314
  throw e; /* node-do-not-add-exception-line */
321
315
  }
322
- diff --git node/node.gyp node/node.gyp
323
- index 2e41a7bb22..6131b75467 100644
324
- --- node/node.gyp
325
- +++ node/node.gyp
326
- @@ -110,6 +110,9 @@
327
- },
328
-
329
- 'conditions': [
330
- + ['target_arch=="arm64"', {
331
- + 'cflags': ['-msign-return-address=all'], # Pointer authentication.
332
- + }],
333
- ['OS in "aix os400"', {
334
- 'ldflags': [
335
- '-Wl,-bnoerrmsg',
336
316
  diff --git node/src/inspector_agent.cc node/src/inspector_agent.cc
337
- index 02842c7e5e..ff15f069c3 100644
317
+ index de372400fd..2538afa37d 100644
338
318
  --- node/src/inspector_agent.cc
339
319
  +++ node/src/inspector_agent.cc
340
- @@ -696,8 +696,6 @@ bool Agent::Start(const std::string& path,
320
+ @@ -707,8 +707,6 @@ bool Agent::Start(const std::string& path,
341
321
  StartIoThreadAsyncCallback));
342
322
  uv_unref(reinterpret_cast<uv_handle_t*>(&start_io_thread_async));
343
323
  start_io_thread_async.data = this;
@@ -347,10 +327,10 @@ index 02842c7e5e..ff15f069c3 100644
347
327
  parent_env_->AddCleanupHook([](void* data) {
348
328
  Environment* env = static_cast<Environment*>(data);
349
329
  diff --git node/src/node.cc node/src/node.cc
350
- index 6bdcbb3de9..f94d3d396d 100644
330
+ index 524f80ee69..419cb95c4c 100644
351
331
  --- node/src/node.cc
352
332
  +++ node/src/node.cc
353
- @@ -303,6 +303,8 @@ MaybeLocal<Value> StartExecution(Environment* env, StartExecutionCallback cb) {
333
+ @@ -322,6 +322,8 @@ MaybeLocal<Value> StartExecution(Environment* env, StartExecutionCallback cb) {
354
334
  return env->RunSnapshotDeserializeMain();
355
335
  }
356
336
 
@@ -359,7 +339,7 @@ index 6bdcbb3de9..f94d3d396d 100644
359
339
  if (env->worker_context() != nullptr) {
360
340
  return StartExecution(env, "internal/main/worker_thread");
361
341
  }
362
- @@ -506,14 +508,6 @@ static void PlatformInit(ProcessInitializationFlags::Flags flags) {
342
+ @@ -543,14 +545,6 @@ static void PlatformInit(ProcessInitializationFlags::Flags flags) {
363
343
  }
364
344
 
365
345
  if (!(flags & ProcessInitializationFlags::kNoDefaultSignalHandling)) {
@@ -375,40 +355,46 @@ index 6bdcbb3de9..f94d3d396d 100644
375
355
  }
376
356
 
377
357
  diff --git node/src/node_contextify.cc node/src/node_contextify.cc
378
- index 5aadefd84d..f9c307b178 100644
358
+ index a68f6bb686..eab5eb9b8b 100644
379
359
  --- node/src/node_contextify.cc
380
360
  +++ node/src/node_contextify.cc
381
- @@ -75,6 +75,7 @@ using v8::ScriptOrigin;
382
- using v8::String;
361
+ @@ -75,6 +75,7 @@ using v8::String;
362
+ using v8::Symbol;
383
363
  using v8::Uint32;
384
364
  using v8::UnboundScript;
385
365
  +using v8::V8;
386
366
  using v8::Value;
387
367
  using v8::WeakCallbackInfo;
388
- using v8::WeakCallbackType;
389
- @@ -771,11 +772,12 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
368
+
369
+ @@ -798,13 +799,14 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
390
370
  Local<ArrayBufferView> cached_data_buf;
391
371
  bool produce_cached_data = false;
392
372
  Local<Context> parsing_context = context;
393
373
  + bool sourceless = false;
394
374
 
375
+ Local<Symbol> id_symbol;
395
376
  if (argc > 2) {
396
377
  // new ContextifyScript(code, filename, lineOffset, columnOffset,
397
- // cachedData, produceCachedData, parsingContext)
398
- - CHECK_EQ(argc, 7);
399
- + CHECK_EQ(argc, 8);
378
+ // cachedData, produceCachedData, parsingContext,
379
+ - // hostDefinedOptionId)
380
+ - CHECK_EQ(argc, 8);
381
+ + // hostDefinedOptionId, sourceless)
382
+ + CHECK_GE(argc, 8);
400
383
  CHECK(args[2]->IsNumber());
401
384
  line_offset = args[2].As<Int32>()->Value();
402
385
  CHECK(args[3]->IsNumber());
403
- @@ -794,6 +796,7 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
404
- CHECK_NOT_NULL(sandbox);
405
- parsing_context = sandbox->context();
386
+ @@ -825,6 +827,10 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
406
387
  }
407
- + sourceless = args[7]->IsTrue();
388
+ CHECK(args[7]->IsSymbol());
389
+ id_symbol = args[7].As<Symbol>();
390
+ + if (argc > 8) {
391
+ + CHECK(args[8]->IsBoolean());
392
+ + sourceless = args[8]->IsTrue();
393
+ + }
408
394
  }
409
395
 
410
396
  ContextifyScript* contextify_script =
411
- @@ -844,6 +847,10 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
397
+ @@ -873,6 +879,10 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
412
398
  ShouldNotAbortOnUncaughtScope no_abort_scope(env);
413
399
  Context::Scope scope(parsing_context);
414
400
 
@@ -419,21 +405,19 @@ index 5aadefd84d..f9c307b178 100644
419
405
  MaybeLocal<UnboundScript> maybe_v8_script =
420
406
  ScriptCompiler::CompileUnboundScript(isolate, &source, compile_options);
421
407
 
422
- @@ -857,6 +864,13 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
423
- "ContextifyScript::New");
408
+ @@ -887,6 +897,11 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
424
409
  return;
425
410
  }
426
- +
411
+
427
412
  + if (sourceless && compile_options == ScriptCompiler::kConsumeCodeCache) {
428
413
  + if (!source.GetCachedData()->rejected) {
429
414
  + V8::FixSourcelessScript(env->isolate(), v8_script);
430
415
  + }
431
416
  + }
432
- +
433
417
  contextify_script->script_.Reset(isolate, v8_script);
434
-
435
- std::unique_ptr<ScriptCompiler::CachedData> new_cached_data;
436
- @@ -881,6 +895,10 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
418
+ contextify_script->script_.SetWeak();
419
+ contextify_script->object()->SetInternalFieldForNodeCore(kUnboundScriptSlot,
420
+ @@ -920,6 +935,10 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
437
421
  .IsNothing())
438
422
  return;
439
423
 
@@ -445,7 +429,7 @@ index 5aadefd84d..f9c307b178 100644
445
429
  }
446
430
 
447
431
  diff --git node/src/node_main.cc node/src/node_main.cc
448
- index 56deaf47fa..e7ffa1baaa 100644
432
+ index f66099a557..4048f6bd93 100644
449
433
  --- node/src/node_main.cc
450
434
  +++ node/src/node_main.cc
451
435
  @@ -22,6 +22,8 @@
@@ -555,10 +539,10 @@ index 56deaf47fa..e7ffa1baaa 100644
555
539
  + return adjacent(c, nargv);
556
540
  +}
557
541
  diff --git node/src/node_options.cc node/src/node_options.cc
558
- index e7b0ba1073..530d56bd76 100644
542
+ index 5da6918af8..56c793ba96 100644
559
543
  --- node/src/node_options.cc
560
544
  +++ node/src/node_options.cc
561
- @@ -301,6 +301,7 @@ void Parse(
545
+ @@ -302,6 +302,7 @@ void Parse(
562
546
  // TODO(addaleax): Make that unnecessary.
563
547
 
564
548
  DebugOptionsParser::DebugOptionsParser() {
@@ -567,7 +551,7 @@ index e7b0ba1073..530d56bd76 100644
567
551
  if (sea::IsSingleExecutable()) return;
568
552
  #endif
569
553
  diff --git node/tools/icu/icu-generic.gyp node/tools/icu/icu-generic.gyp
570
- index db45e6fbdf..3e39f1fbdf 100644
554
+ index 2655b9e694..1d951571c7 100644
571
555
  --- node/tools/icu/icu-generic.gyp
572
556
  +++ node/tools/icu/icu-generic.gyp
573
557
  @@ -52,7 +52,7 @@
@@ -1,6 +1,6 @@
1
1
  {
2
- "v19.8.1": ["node.v19.8.1.cpp.patch"],
3
- "v18.18.2": ["node.v18.18.2.cpp.patch"],
2
+ "v20.11.0": ["node.v20.11.0.cpp.patch"],
3
+ "v18.19.0": ["node.v18.19.0.cpp.patch"],
4
4
  "v16.20.2": ["node.v16.20.2.cpp.patch"],
5
5
  "v14.21.3": ["node.v14.21.3.cpp.patch"],
6
6
  "v12.22.11": ["node.v12.22.11.cpp.patch"],