From 023cd0a6986b9f16b2a9708e52b5d9807bd2c762 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`.) Fixes: https://github.com/nodejs/node/issues/19044 Refs: https://github.com/nodejs/node/pull/18623 --- 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 0d9cfd6df4d12a..08c712f8be0daf 100644 --- a/lib/internal/v8_prof_processor.js +++ b/lib/internal/v8_prof_processor.js @@ -34,9 +34,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);