diff --git a/lib/internal/process/execution.js b/lib/internal/process/execution.js index 48c525057f7477..e10a4f413cdd0d 100644 --- a/lib/internal/process/execution.js +++ b/lib/internal/process/execution.js @@ -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) { @@ -158,7 +152,7 @@ function createOnGlobalUncaughtException() { 'Exception', 'Exception', null, - er ? er : {}); + er ?? {}); } } catch {} // Ignore the exception. Diagnostic reporting is unavailable. }