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 60e612d commit 4dd2749Copy full SHA for 4dd2749
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
'internal/deps/v8/tools/splaytree',
@@ -31,9 +34,9 @@ if (process.platform === 'darwin') {
31
34
tickArguments.push('--windows');
32
35
}
33
36
tickArguments.push.apply(tickArguments, process.argv.slice(1));
-script = `(function() {
37
+script = `(function(require) {
38
arguments = ${JSON.stringify(tickArguments)};
39
function write (s) { process.stdout.write(s) }
40
${script}
-})()`;
-eval(script);
41
+})`;
42
+vm.runInThisContext(script)(require);
0 commit comments