From 471bc9b7107654602697ce0c32721298f717b235 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 30 Sep 2021 23:13:32 +0200 Subject: [PATCH] lib: refactor to avoid unsafe array iteration --- lib/internal/v8_prof_processor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/internal/v8_prof_processor.js b/lib/internal/v8_prof_processor.js index ddfafca64c45f0..4ed6fe8b9b3902 100644 --- a/lib/internal/v8_prof_processor.js +++ b/lib/internal/v8_prof_processor.js @@ -2,6 +2,7 @@ const { ArrayPrototypePush, + ArrayPrototypePushApply, ArrayPrototypeSlice, StringPrototypeSlice, } = primordials; @@ -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,