From e584113b66b14b3c07ecbedf47d9bb73c2849e90 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 28 Feb 2018 14:23:08 +0000 Subject: [PATCH] lib: re-fix v8_prof_processor Make the script not error out immediately because of a missing pseudo-global. (Note that it seems like tests are still broken on `master`.) PR-URL: https://github.com/nodejs/node/pull/19059 Fixes: https://github.com/nodejs/node/issues/19044 Refs: https://github.com/nodejs/node/pull/18623 Reviewed-By: Colin Ihrig Reviewed-By: Evan Lucas Reviewed-By: James M Snell Reviewed-By: Matheus Marchini Reviewed-By: Minwoo Jung Reviewed-By: Ruben Bridgewater --- lib/internal/v8_prof_processor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/v8_prof_processor.js b/lib/internal/v8_prof_processor.js index bb71213a8f4dae..7592253060294c 100644 --- a/lib/internal/v8_prof_processor.js +++ b/lib/internal/v8_prof_processor.js @@ -33,9 +33,9 @@ if (process.platform === 'darwin') { tickArguments.push('--windows'); } tickArguments.push.apply(tickArguments, process.argv.slice(1)); -script = `(function(require) { +script = `(function(module, require) { arguments = ${JSON.stringify(tickArguments)}; function write (s) { process.stdout.write(s) } ${script} })`; -vm.runInThisContext(script)(require); +vm.runInThisContext(script)(module, require);