Skip to content

Commit

Permalink
lib: refactor to avoid unsafe array iteration
Browse files Browse the repository at this point in the history
PR-URL: #40271
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
  • Loading branch information
aduh95 authored and nodejs-github-bot committed Oct 3, 2021
1 parent 5ae72b7 commit e2382d0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/internal/v8_prof_processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const {
ArrayPrototypePush,
ArrayPrototypePushApply,
ArrayPrototypeSlice,
StringPrototypeSlice,
} = primordials;
Expand All @@ -27,8 +28,8 @@ async function linker(specifier, referencingModule) {
} else if (process.platform === 'win32') {
ArrayPrototypePush(tickArguments, '--windows');
}
ArrayPrototypePush(tickArguments,
...ArrayPrototypeSlice(process.argv, 1));
ArrayPrototypePushApply(tickArguments,
ArrayPrototypeSlice(process.argv, 1));

const context = vm.createContext({
arguments: tickArguments,
Expand Down

0 comments on commit e2382d0

Please sign in to comment.