From 953173b0d74a98f62e28a14c5aea5b0dbbf0fd24 Mon Sep 17 00:00:00 2001 From: Ali Ijaz Sheikh Date: Sun, 24 Jan 2016 09:32:14 -0800 Subject: [PATCH] lib: wrap tick_processor scripts in IIFE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/4722 Reviewed-By: Ben Noordhuis Reviewed-By: Michaƫl Zasso --- lib/internal/v8_prof_processor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/internal/v8_prof_processor.js b/lib/internal/v8_prof_processor.js index 05452c1808..c84b3104d2 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);