Skip to content

Commit b700900

Browse files
aduh95danielleadams
authored andcommitted
lib: refactor to use more primordials
PR-URL: #35875 Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 9757b47 commit b700900

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/internal/v8_prof_processor.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict';
22

33
const {
4+
ArrayPrototypePush,
5+
ArrayPrototypeSlice,
46
JSONStringify,
57
} = primordials;
68

@@ -22,17 +24,18 @@ const scriptFiles = [
2224
];
2325
let script = '';
2426

25-
scriptFiles.forEach((s) => {
27+
for (const s of scriptFiles) {
2628
script += internalBinding('natives')[s] + '\n';
27-
});
29+
}
2830

2931
const tickArguments = [];
3032
if (process.platform === 'darwin') {
31-
tickArguments.push('--mac');
33+
ArrayPrototypePush(tickArguments, '--mac');
3234
} else if (process.platform === 'win32') {
33-
tickArguments.push('--windows');
35+
ArrayPrototypePush(tickArguments, '--windows');
3436
}
35-
tickArguments.push.apply(tickArguments, process.argv.slice(1));
37+
ArrayPrototypePush(tickArguments,
38+
...ArrayPrototypeSlice(process.argv, 1));
3639
script = `(function(module, require) {
3740
arguments = ${JSONStringify(tickArguments)};
3841
function write (s) { process.stdout.write(s) }

0 commit comments

Comments
 (0)