diff --git a/lib/internal/v8_prof_processor.js b/lib/internal/v8_prof_processor.js index 05452c18084..c84b3104d20 100644 --- a/lib/internal/v8_prof_processor.js +++ b/lib/internal/v8_prof_processor.js @@ -25,5 +25,8 @@ if (process.platform === 'darwin') { tickArguments.push('--windows'); } tickArguments.push.apply(tickArguments, process.argv.slice(1)); -script = 'arguments = ' + JSON.stringify(tickArguments) + ';\n' + script; +script = `(function() { + arguments = ${JSON.stringify(tickArguments)}; + ${script} +})()`; eval(script);