Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions lib/internal/process/execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,9 @@ function evalModule(source, print) {
if (print) {
throw new ERR_EVAL_ESM_CANNOT_PRINT();
}
const { log } = require('internal/console/global');
const { loadESM } = require('internal/process/esm_loader');
const { handleMainPromise } = require('internal/modules/run_main');
return handleMainPromise(loadESM(async (loader) => {
const { result } = await loader.eval(source);
if (print) {
log(result);
}
}));
return handleMainPromise(loadESM((loader) => loader.eval(source)));
}

function evalScript(name, body, breakFirstLine, print) {
Expand Down Expand Up @@ -158,7 +152,7 @@ function createOnGlobalUncaughtException() {
'Exception',
'Exception',
null,
er ? er : {});
er ?? {});
}
} catch {} // Ignore the exception. Diagnostic reporting is unavailable.
}
Expand Down