@yao-pkg/pkg-fetch 3.5.31 → 3.5.33

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/lib-es5/utils.js CHANGED
@@ -1,173 +1,105 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
39
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
40
4
  };
41
5
  Object.defineProperty(exports, "__esModule", { value: true });
42
6
  exports.nodeBinarySortFunction = exports.spawn = exports.plusx = exports.hash = exports.downloadUrl = void 0;
43
- var node_fetch_1 = __importDefault(require("node-fetch"));
44
- var crypto_1 = __importDefault(require("crypto"));
45
- var fs_1 = require("fs");
46
- var promises_1 = require("fs/promises");
47
- var https_proxy_agent_1 = __importDefault(require("https-proxy-agent"));
48
- var path_1 = __importDefault(require("path"));
49
- var child_process_1 = require("child_process");
50
- var stream_1 = __importDefault(require("stream"));
51
- var semver_1 = require("semver");
52
- var log_1 = require("./log");
53
- function downloadUrl(url, file) {
54
- var _a, _b, _c;
55
- return __awaiter(this, void 0, void 0, function () {
56
- var proxy, res, err_1, tempFile, ws, totalSize, currentSize;
57
- return __generator(this, function (_d) {
58
- switch (_d.label) {
59
- case 0:
60
- log_1.log.enableProgress(path_1.default.basename(file));
61
- log_1.log.showProgress(0);
62
- proxy = (_c = (_b = (_a = process.env.HTTPS_PROXY) !== null && _a !== void 0 ? _a : process.env.https_proxy) !== null && _b !== void 0 ? _b : process.env.HTTP_PROXY) !== null && _c !== void 0 ? _c : process.env.http_proxy;
63
- _d.label = 1;
64
- case 1:
65
- _d.trys.push([1, 3, , 4]);
66
- return [4 /*yield*/, (0, node_fetch_1.default)(url, proxy ? { agent: (0, https_proxy_agent_1.default)(proxy) } : undefined)];
67
- case 2:
68
- res = _d.sent();
69
- return [3 /*break*/, 4];
70
- case 3:
71
- err_1 = _d.sent();
72
- log_1.log.disableProgress();
73
- throw (0, log_1.wasReported)("Network error during fetch: ".concat(err_1.message));
74
- case 4:
75
- if (!res.ok) {
76
- log_1.log.disableProgress();
77
- throw (0, log_1.wasReported)("".concat(res.status, ": ").concat(res.statusText));
78
- }
79
- tempFile = "".concat(file, ".downloading");
80
- (0, fs_1.mkdirSync)(path_1.default.dirname(tempFile), { recursive: true });
81
- ws = (0, fs_1.createWriteStream)(tempFile);
82
- totalSize = Number(res.headers.get('content-length'));
83
- currentSize = 0;
84
- res.body.on('data', function (chunk) {
85
- if (totalSize != null && totalSize !== 0) {
86
- currentSize += chunk.length;
87
- log_1.log.showProgress((currentSize / totalSize) * 100);
88
- }
89
- });
90
- res.body.pipe(ws);
91
- return [2 /*return*/, new Promise(function (resolve, reject) {
92
- stream_1.default.finished(ws, function (err) {
93
- if (err) {
94
- log_1.log.disableProgress();
95
- (0, fs_1.rmSync)(tempFile);
96
- reject((0, log_1.wasReported)("".concat(err.name, ": ").concat(err.message)));
97
- }
98
- else {
99
- log_1.log.showProgress(100);
100
- log_1.log.disableProgress();
101
- (0, fs_1.renameSync)(tempFile, file);
102
- resolve();
103
- }
104
- });
105
- })];
7
+ const node_fetch_1 = __importDefault(require("node-fetch"));
8
+ const crypto_1 = __importDefault(require("crypto"));
9
+ const fs_1 = require("fs");
10
+ const promises_1 = require("fs/promises");
11
+ const https_proxy_agent_1 = __importDefault(require("https-proxy-agent"));
12
+ const path_1 = __importDefault(require("path"));
13
+ const child_process_1 = require("child_process");
14
+ const stream_1 = __importDefault(require("stream"));
15
+ const semver_1 = require("semver");
16
+ const log_1 = require("./log");
17
+ async function downloadUrl(url, file) {
18
+ log_1.log.enableProgress(path_1.default.basename(file));
19
+ log_1.log.showProgress(0);
20
+ const proxy = process.env.HTTPS_PROXY ??
21
+ process.env.https_proxy ??
22
+ process.env.HTTP_PROXY ??
23
+ process.env.http_proxy;
24
+ let res;
25
+ try {
26
+ res = await (0, node_fetch_1.default)(url, proxy ? { agent: (0, https_proxy_agent_1.default)(proxy) } : undefined);
27
+ }
28
+ catch (err) {
29
+ log_1.log.disableProgress();
30
+ throw (0, log_1.wasReported)(`Network error during fetch: ${err.message}`);
31
+ }
32
+ if (!res.ok) {
33
+ log_1.log.disableProgress();
34
+ throw (0, log_1.wasReported)(`${res.status}: ${res.statusText}`);
35
+ }
36
+ const tempFile = `${file}.downloading`;
37
+ (0, fs_1.mkdirSync)(path_1.default.dirname(tempFile), { recursive: true });
38
+ const ws = (0, fs_1.createWriteStream)(tempFile);
39
+ const totalSize = Number(res.headers.get('content-length'));
40
+ let currentSize = 0;
41
+ res.body.on('data', (chunk) => {
42
+ if (totalSize != null && totalSize !== 0) {
43
+ currentSize += chunk.length;
44
+ log_1.log.showProgress((currentSize / totalSize) * 100);
45
+ }
46
+ });
47
+ res.body.pipe(ws);
48
+ return new Promise((resolve, reject) => {
49
+ stream_1.default.finished(ws, (err) => {
50
+ if (err) {
51
+ log_1.log.disableProgress();
52
+ (0, fs_1.rmSync)(tempFile);
53
+ reject((0, log_1.wasReported)(`${err.name}: ${err.message}`));
54
+ }
55
+ else {
56
+ log_1.log.showProgress(100);
57
+ log_1.log.disableProgress();
58
+ (0, fs_1.renameSync)(tempFile, file);
59
+ resolve();
106
60
  }
107
61
  });
108
62
  });
109
63
  }
110
64
  exports.downloadUrl = downloadUrl;
111
- function hash(filePath) {
112
- return __awaiter(this, void 0, void 0, function () {
113
- return __generator(this, function (_a) {
114
- return [2 /*return*/, new Promise(function (resolve, reject) {
115
- var resultHash = crypto_1.default.createHash('sha256');
116
- var input = (0, fs_1.createReadStream)(filePath);
117
- input.on('error', function (e) {
118
- reject(e);
119
- });
120
- input.on('readable', function () {
121
- var data = input.read();
122
- if (data) {
123
- resultHash.update(data);
124
- }
125
- else {
126
- resolve(resultHash.digest('hex'));
127
- }
128
- });
129
- })];
65
+ async function hash(filePath) {
66
+ return new Promise((resolve, reject) => {
67
+ const resultHash = crypto_1.default.createHash('sha256');
68
+ const input = (0, fs_1.createReadStream)(filePath);
69
+ input.on('error', (e) => {
70
+ reject(e);
130
71
  });
131
- });
132
- }
133
- exports.hash = hash;
134
- function plusx(file) {
135
- return __awaiter(this, void 0, void 0, function () {
136
- var s, newMode, base8;
137
- return __generator(this, function (_a) {
138
- switch (_a.label) {
139
- case 0: return [4 /*yield*/, (0, promises_1.stat)(file)];
140
- case 1:
141
- s = _a.sent();
142
- newMode = s.mode | 64 | 8 | 1;
143
- if (s.mode === newMode)
144
- return [2 /*return*/];
145
- base8 = newMode.toString(8).slice(-3);
146
- return [4 /*yield*/, (0, promises_1.chmod)(file, base8)];
147
- case 2:
148
- _a.sent();
149
- return [2 /*return*/];
72
+ input.on('readable', () => {
73
+ const data = input.read();
74
+ if (data) {
75
+ resultHash.update(data);
76
+ }
77
+ else {
78
+ resolve(resultHash.digest('hex'));
150
79
  }
151
80
  });
152
81
  });
153
82
  }
83
+ exports.hash = hash;
84
+ async function plusx(file) {
85
+ const s = await (0, promises_1.stat)(file);
86
+ const newMode = s.mode | 64 | 8 | 1;
87
+ if (s.mode === newMode)
88
+ return;
89
+ const base8 = newMode.toString(8).slice(-3);
90
+ await (0, promises_1.chmod)(file, base8);
91
+ }
154
92
  exports.plusx = plusx;
155
- function spawn(command, args, options) {
156
- return __awaiter(this, void 0, void 0, function () {
157
- var error;
158
- return __generator(this, function (_a) {
159
- error = (0, child_process_1.spawnSync)(command, args, options).error;
160
- if (error) {
161
- throw error;
162
- }
163
- return [2 /*return*/];
164
- });
165
- });
93
+ async function spawn(command, args, options) {
94
+ const { error } = (0, child_process_1.spawnSync)(command, args, options);
95
+ if (error) {
96
+ throw error;
97
+ }
166
98
  }
167
99
  exports.spawn = spawn;
168
100
  function nodeBinarySortFunction(a, b) {
169
- var coercedVersionA = (0, semver_1.coerce)(a);
170
- var coercedVersionB = (0, semver_1.coerce)(b);
101
+ const coercedVersionA = (0, semver_1.coerce)(a);
102
+ const coercedVersionB = (0, semver_1.coerce)(b);
171
103
  if (coercedVersionA && coercedVersionB) {
172
104
  return coercedVersionA.compare(coercedVersionB);
173
105
  }
package/lib-es5/verify.js CHANGED
@@ -1,59 +1,124 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
2
  Object.defineProperty(exports, "__esModule", { value: true });
39
3
  exports.verify = void 0;
40
- var child_process_1 = require("child_process");
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 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
- function verify(local) {
44
- return __awaiter(this, void 0, void 0, function () {
45
- return __generator(this, function (_a) {
46
- switch (_a.label) {
47
- case 0: return [4 /*yield*/, (0, utils_1.plusx)(local)];
48
- case 1:
49
- _a.sent();
50
- (0, child_process_1.spawnSync)(local, ['-e', script], {
51
- env: { PKG_EXECPATH: 'PKG_INVOKE_NODEJS' },
52
- stdio: 'inherit',
53
- });
54
- return [2 /*return*/];
55
- }
56
- });
4
+ const child_process_1 = require("child_process");
5
+ const utils_1 = require("./utils");
6
+ const script = `
7
+ var vm = require('vm');
8
+ var assert = require('assert');
9
+ var text = '(function () { return 42; })';
10
+ var cd, fn, result;
11
+ var modules = process.versions.modules | 0;
12
+ var v8 = process.versions.v8.split('.').slice(0, 2).join('.');
13
+
14
+ var s1 = new vm.Script(text, { filename: 's1', produceCachedData: true, sourceless: true });
15
+ assert(s1.cachedDataProduced);
16
+ cd = s1.cachedData;
17
+
18
+ var kCpuFeaturesOffset, cpuFeatures;
19
+
20
+ if (modules === 14) {
21
+ } else
22
+ if (modules === 46 || modules === 48 || modules === 51) {
23
+ kCpuFeaturesOffset = 0x0c;
24
+ } else
25
+ if (modules === 57) {
26
+ if (v8 === '6.2') {
27
+ kCpuFeaturesOffset = 0x0c;
28
+ } else
29
+ if (v8 === '5.8') {
30
+ kCpuFeaturesOffset = 0x0c;
31
+ } else {
32
+ kCpuFeaturesOffset = 0x10;
33
+ }
34
+ } else
35
+ if (modules === 59) {
36
+ kCpuFeaturesOffset = 0x0c;
37
+ } else
38
+ if (modules === 64) {
39
+ kCpuFeaturesOffset = 0x0c;
40
+ } else
41
+ if (modules === 72) {
42
+ // no cpu features anymore
43
+ } else
44
+ if (modules === 79) {
45
+ // no cpu features anymore
46
+ } else
47
+ if (modules === 83) {
48
+ // no cpu features anymore
49
+ } else
50
+ if (modules === 93) {
51
+ // no cpu features anymore
52
+ } else
53
+ if (modules === 108) {
54
+ // no cpu features anymore
55
+ } else
56
+ if (modules === 111) {
57
+ // no cpu features anymore
58
+ } else
59
+ if (modules === 115) {
60
+ // no cpu features anymore
61
+ } else {
62
+ assert(false, modules);
63
+ }
64
+
65
+ if (modules >= 46 && // no cpu_features field in 0.12
66
+ process.arch !== 'arm' && // non-zero features even in sourceless mode in arm
67
+ modules < 72) { // no cpu_features field in 12+
68
+ cpuFeatures = cd.readUInt32LE(kCpuFeaturesOffset);
69
+ assert(cpuFeatures === 0, 'CPU_FEATURES must be zero');
70
+ }
71
+
72
+ var s2 = new vm.Script(undefined, { filename: 's2', cachedData: cd, sourceless: true });
73
+ fn = s2.runInThisContext();
74
+ result = fn();
75
+ assert.equal(result, 42);
76
+
77
+ if (modules === 14) {
78
+ } else
79
+ if (modules === 46 || modules === 48 ||
80
+ modules === 51 || modules === 57 || modules === 59 || modules === 64) {
81
+ var paddedPayloadOffset = 0x48; // see SerializedCodeData::Payload()
82
+ var index = paddedPayloadOffset + 10;
83
+ cd[index] ^= 0xf0;
84
+ var s3 = new vm.Script(undefined, { filename: 's3', cachedData: cd, sourceless: true });
85
+ assert(s3.cachedDataRejected, 's3.cachedDataRejected must be true');
86
+ } else
87
+ if (modules === 72) {
88
+ } else
89
+ if (modules === 79) {
90
+ } else
91
+ if (modules === 83) {
92
+ } else
93
+ if (modules === 93) {
94
+ } else
95
+ if (modules === 108) {
96
+ } else
97
+ if (modules === 111) {
98
+ } else
99
+ if (modules === 115) {
100
+ } else {
101
+ assert(false, modules);
102
+ }
103
+
104
+ var s4 = new vm.Script(text, { filename: 's4', produceCachedData: true });
105
+ assert(s4.cachedDataProduced, 's4.cachedDataProduced must be true');
106
+ cd = s4.cachedData;
107
+
108
+ if (modules >= 46 && // no cpu_features field in 0.12
109
+ process.arch !== 'arm' && // zero features even in non-sourceless mode in arm
110
+ modules < 72) { // no cpu_features field in 12+
111
+ cpuFeatures = cd.readUInt32LE(kCpuFeaturesOffset);
112
+ assert(cpuFeatures !== 0, 'CPU_FEATURES must be non-zero');
113
+ }
114
+
115
+ console.log('ok');
116
+ `;
117
+ async function verify(local) {
118
+ await (0, utils_1.plusx)(local);
119
+ (0, child_process_1.spawnSync)(local, ['-e', script], {
120
+ env: { PKG_EXECPATH: 'PKG_INVOKE_NODEJS' },
121
+ stdio: 'inherit',
57
122
  });
58
123
  }
59
124
  exports.verify = verify;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yao-pkg/pkg-fetch",
3
- "version": "3.5.31",
3
+ "version": "3.5.33",
4
4
  "description": "Compiles and stores base binaries for pkg",
5
5
  "main": "lib-es5/index.js",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  diff --git node/common.gypi node/common.gypi
2
- index 311b203600..b2ee8cb47d 100644
2
+ index f75cdf47b8..0030fe2ad4 100644
3
3
  --- node/common.gypi
4
4
  +++ node/common.gypi
5
5
  @@ -187,7 +187,7 @@
@@ -69,7 +69,7 @@ index d3e35d6ec5..6e9bbe3849 100644
69
69
  static const char* GetVersion();
70
70
 
71
71
  diff --git node/deps/v8/src/api/api.cc node/deps/v8/src/api/api.cc
72
- index a06394e6c1..154b7a82a8 100644
72
+ index da0c960f99..08af13d77a 100644
73
73
  --- node/deps/v8/src/api/api.cc
74
74
  +++ node/deps/v8/src/api/api.cc
75
75
  @@ -806,6 +806,28 @@ void V8::SetFlagsFromCommandLine(int* argc, char** argv, bool remove_flags) {
@@ -288,10 +288,10 @@ index 88c079d10d..a7eaca0574 100644
288
288
  const permission = require('internal/process/permission');
289
289
  const { kEmptyObject } = require('internal/util');
290
290
  diff --git node/lib/internal/process/pre_execution.js node/lib/internal/process/pre_execution.js
291
- index 0bbabb80c2..5dd097b69e 100644
291
+ index 96bbfb4c35..ff50e19a6a 100644
292
292
  --- node/lib/internal/process/pre_execution.js
293
293
  +++ node/lib/internal/process/pre_execution.js
294
- @@ -50,7 +50,11 @@ const {
294
+ @@ -49,7 +49,11 @@ const {
295
295
  },
296
296
  } = require('internal/v8/startup_snapshot');
297
297
 
@@ -303,7 +303,7 @@ index 0bbabb80c2..5dd097b69e 100644
303
303
  return prepareExecution({
304
304
  expandArgv1,
305
305
  initializeModules,
306
- @@ -243,7 +247,12 @@ function patchProcessObject(expandArgv1) {
306
+ @@ -241,7 +245,12 @@ function patchProcessObject(expandArgv1) {
307
307
  let mainEntry;
308
308
  // If requested, update process.argv[1] to replace whatever the user provided with the resolved absolute file path of
309
309
  // the entry point.
@@ -317,7 +317,7 @@ index 0bbabb80c2..5dd097b69e 100644
317
317
  // Expand process.argv[1] into a full path.
318
318
  const path = require('path');
319
319
  try {
320
- @@ -739,6 +748,7 @@ function loadPreloadModules() {
320
+ @@ -737,6 +746,7 @@ function loadPreloadModules() {
321
321
  // For user code, we preload modules if `-r` is passed
322
322
  const preloadModules = getOptionValue('--require');
323
323
  if (preloadModules && preloadModules.length > 0) {
@@ -1,5 +1,5 @@
1
1
  diff --git node/common.gypi node/common.gypi
2
- index ae31b372b9..b7baff1762 100644
2
+ index b7d84c3ead..1eec82c594 100644
3
3
  --- node/common.gypi
4
4
  +++ node/common.gypi
5
5
  @@ -192,7 +192,7 @@
@@ -59,7 +59,7 @@ index d3e35d6ec5..6e9bbe3849 100644
59
59
  static const char* GetVersion();
60
60
 
61
61
  diff --git node/deps/v8/src/api/api.cc node/deps/v8/src/api/api.cc
62
- index 2dd476dda3..8a51f25b57 100644
62
+ index f9ce798dc2..68af88ab13 100644
63
63
  --- node/deps/v8/src/api/api.cc
64
64
  +++ node/deps/v8/src/api/api.cc
65
65
  @@ -624,6 +624,28 @@ void V8::SetFlagsFromCommandLine(int* argc, char** argv, bool remove_flags) {
@@ -92,7 +92,7 @@ index 2dd476dda3..8a51f25b57 100644
92
92
 
93
93
  RegisteredExtension::RegisteredExtension(std::unique_ptr<Extension> extension)
94
94
  diff --git node/deps/v8/src/codegen/code-stub-assembler.h node/deps/v8/src/codegen/code-stub-assembler.h
95
- index b082bb8dc7..285683ecdc 100644
95
+ index c7c92eed93..9eaea3aaa8 100644
96
96
  --- node/deps/v8/src/codegen/code-stub-assembler.h
97
97
  +++ node/deps/v8/src/codegen/code-stub-assembler.h
98
98
  @@ -286,7 +286,8 @@ enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol };
@@ -196,10 +196,10 @@ index 529e283bbf..c997c53a18 100644
196
196
  ClassPositions::cast(*maybe_class_positions);
197
197
  int start_position = class_positions->start();
198
198
  diff --git node/deps/v8/src/objects/objects.cc node/deps/v8/src/objects/objects.cc
199
- index 8e013c2544..7ac03149d8 100644
199
+ index 535ee9ed70..cf1e06d4fc 100644
200
200
  --- node/deps/v8/src/objects/objects.cc
201
201
  +++ node/deps/v8/src/objects/objects.cc
202
- @@ -4263,7 +4263,12 @@ void Script::InitLineEndsInternal(IsolateT* isolate, Handle<Script> script) {
202
+ @@ -4246,7 +4246,12 @@ void Script::InitLineEndsInternal(IsolateT* isolate, Handle<Script> script) {
203
203
 
204
204
  void Script::SetSource(Isolate* isolate, Handle<Script> script,
205
205
  Handle<String> source) {
@@ -349,7 +349,7 @@ index 0000000000..a697294fdf
349
349
  + }());
350
350
  +}());
351
351
  diff --git node/lib/internal/modules/cjs/loader.js node/lib/internal/modules/cjs/loader.js
352
- index a7d8fa1139..bffe5a8a53 100644
352
+ index b87f557c16..051fbc140a 100644
353
353
  --- node/lib/internal/modules/cjs/loader.js
354
354
  +++ node/lib/internal/modules/cjs/loader.js
355
355
  @@ -252,14 +252,18 @@ function stat(filename) {
@@ -410,10 +410,10 @@ index 0f9442ea7a..e30582b3cc 100644
410
410
  __proto__: null,
411
411
  ...result.data,
412
412
  diff --git node/lib/internal/process/pre_execution.js node/lib/internal/process/pre_execution.js
413
- index d12d21905c..cf8a5c9096 100644
413
+ index 3546544ad0..7a285054a5 100644
414
414
  --- node/lib/internal/process/pre_execution.js
415
415
  +++ node/lib/internal/process/pre_execution.js
416
- @@ -50,7 +50,11 @@ const {
416
+ @@ -49,7 +49,11 @@ const {
417
417
  runDeserializeCallbacks,
418
418
  } = require('internal/v8/startup_snapshot');
419
419
 
@@ -425,7 +425,7 @@ index d12d21905c..cf8a5c9096 100644
425
425
  return prepareExecution({
426
426
  expandArgv1,
427
427
  initializeModules,
428
- @@ -265,7 +269,8 @@ function patchProcessObject(expandArgv1) {
428
+ @@ -266,7 +270,8 @@ function patchProcessObject(expandArgv1) {
429
429
  let mainEntry;
430
430
  // If requested, update process.argv[1] to replace whatever the user provided with the resolved absolute file path of
431
431
  // the entry point.
@@ -435,7 +435,7 @@ index d12d21905c..cf8a5c9096 100644
435
435
  // Expand process.argv[1] into a full path.
436
436
  const path = require('path');
437
437
  try {
438
- @@ -747,6 +752,7 @@ function loadPreloadModules() {
438
+ @@ -748,6 +753,7 @@ function loadPreloadModules() {
439
439
  // For user code, we preload modules if `-r` is passed
440
440
  const preloadModules = getOptionValue('--require');
441
441
  if (preloadModules && preloadModules.length > 0) {
@@ -482,7 +482,7 @@ index 2318c4e0df..fb998531a7 100644
482
482
  parent_env_->AddCleanupHook([](void* data) {
483
483
  Environment* env = static_cast<Environment*>(data);
484
484
  diff --git node/src/node.cc node/src/node.cc
485
- index 2d8d0000d5..178fdaede0 100644
485
+ index db0011b429..bb6dfa8f5f 100644
486
486
  --- node/src/node.cc
487
487
  +++ node/src/node.cc
488
488
  @@ -404,6 +404,8 @@ MaybeLocal<Value> StartExecution(Environment* env, StartExecutionCallback cb) {
@@ -695,7 +695,7 @@ index f66099a557..4048f6bd93 100644
695
695
  + return adjacent(c, nargv);
696
696
  +}
697
697
  diff --git node/src/node_options.cc node/src/node_options.cc
698
- index 31fc23fdbf..8458d7796e 100644
698
+ index 5b74045886..2dfb7bd76e 100644
699
699
  --- node/src/node_options.cc
700
700
  +++ node/src/node_options.cc
701
701
  @@ -359,7 +359,7 @@ void Parse(