mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
lib: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/35875 Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
const {
|
||||
ArrayPrototypePush,
|
||||
ArrayPrototypeSlice,
|
||||
JSONStringify,
|
||||
} = primordials;
|
||||
|
||||
@@ -22,17 +24,18 @@ const scriptFiles = [
|
||||
];
|
||||
let script = '';
|
||||
|
||||
scriptFiles.forEach((s) => {
|
||||
for (const s of scriptFiles) {
|
||||
script += internalBinding('natives')[s] + '\n';
|
||||
});
|
||||
}
|
||||
|
||||
const tickArguments = [];
|
||||
if (process.platform === 'darwin') {
|
||||
tickArguments.push('--mac');
|
||||
ArrayPrototypePush(tickArguments, '--mac');
|
||||
} else if (process.platform === 'win32') {
|
||||
tickArguments.push('--windows');
|
||||
ArrayPrototypePush(tickArguments, '--windows');
|
||||
}
|
||||
tickArguments.push.apply(tickArguments, process.argv.slice(1));
|
||||
ArrayPrototypePush(tickArguments,
|
||||
...ArrayPrototypeSlice(process.argv, 1));
|
||||
script = `(function(module, require) {
|
||||
arguments = ${JSONStringify(tickArguments)};
|
||||
function write (s) { process.stdout.write(s) }
|
||||
|
||||
Reference in New Issue
Block a user