Skip to content

Commit 3d5eba8

Browse files
aduh95targos
authored andcommitted
lib: refactor to avoid unsafe array iteration
PR-URL: #40271 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
1 parent a75a8f2 commit 3d5eba8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/internal/v8_prof_processor.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const {
44
ArrayPrototypePush,
5+
ArrayPrototypePushApply,
56
ArrayPrototypeSlice,
67
StringPrototypeSlice,
78
} = primordials;
@@ -27,8 +28,8 @@ async function linker(specifier, referencingModule) {
2728
} else if (process.platform === 'win32') {
2829
ArrayPrototypePush(tickArguments, '--windows');
2930
}
30-
ArrayPrototypePush(tickArguments,
31-
...ArrayPrototypeSlice(process.argv, 1));
31+
ArrayPrototypePushApply(tickArguments,
32+
ArrayPrototypeSlice(process.argv, 1));
3233

3334
const context = vm.createContext({
3435
arguments: tickArguments,

0 commit comments

Comments
 (0)