Skip to content

Commit

Permalink
lib: refactor to use more primordials
Browse files Browse the repository at this point in the history
PR-URL: #35875
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
aduh95 authored and danielleadams committed Nov 9, 2020
1 parent 9757b47 commit b700900
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/internal/v8_prof_processor.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'use strict';

const {
ArrayPrototypePush,
ArrayPrototypeSlice,
JSONStringify,
} = primordials;

Expand All @@ -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) }
Expand Down

0 comments on commit b700900

Please sign in to comment.