We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
eval
vm.runInThisContext
1 parent 1bff0aa commit 810925bCopy full SHA for 810925b
lib/internal/v8_prof_processor.js
@@ -1,4 +1,7 @@
1
-/* eslint-disable strict */
+'use strict';
2
+
3
+const vm = require('vm');
4
5
const scriptFiles = [
6
'internal/v8_prof_polyfill',
7
'v8/tools/splaytree',
@@ -30,9 +33,9 @@ if (process.platform === 'darwin') {
30
33
tickArguments.push('--windows');
31
34
}
32
35
tickArguments.push.apply(tickArguments, process.argv.slice(1));
-script = `(function() {
36
+script = `(function(require) {
37
arguments = ${JSON.stringify(tickArguments)};
38
function write (s) { process.stdout.write(s) }
39
${script}
-})()`;
-eval(script);
40
+})`;
41
+vm.runInThisContext(script)(require);
0 commit comments