Skip to content

Commit f06622c

Browse files
cjihrigMylesBorins
authored andcommitted
lib: define printErr() in script string
This commit moves the printErr() function, used by the tick profiler processer, into the code string passed to vm.runInThisContext(). PR-URL: #19285 Fixes: #19260 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent f84f548 commit f06622c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/internal/v8_prof_processor.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ scriptFiles.forEach(function(s) {
2121
script += process.binding('natives')[s] + '\n';
2222
});
2323

24-
// eslint-disable-next-line no-unused-vars
25-
function printErr(err) {
26-
console.error(err);
27-
}
28-
2924
const tickArguments = [];
3025
if (process.platform === 'darwin') {
3126
tickArguments.push('--mac');
@@ -36,6 +31,7 @@ tickArguments.push.apply(tickArguments, process.argv.slice(1));
3631
script = `(function(module, require) {
3732
arguments = ${JSON.stringify(tickArguments)};
3833
function write (s) { process.stdout.write(s) }
34+
function printErr(err) { console.error(err); }
3935
${script}
4036
})`;
4137
vm.runInThisContext(script)(module, require);

0 commit comments

Comments
 (0)