| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1c8590e commit 58de6ce
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -42,15 +42,9 @@ function evalModule(source, print) { | |||
| 42 | 42 | if (print) { | |
| 43 | 43 | throw new ERR_EVAL_ESM_CANNOT_PRINT(); | |
| 44 | 44 | } | |
| 45 | - const { log } = require('internal/console/global'); | ||
| 46 | 45 | const { loadESM } = require('internal/process/esm_loader'); | |
| 47 | 46 | const { handleMainPromise } = require('internal/modules/run_main'); | |
| 48 | - return handleMainPromise(loadESM(async (loader) => { | ||
| 49 | - const { result } = await loader.eval(source); | ||
| 50 | - if (print) { | ||
| 51 | - log(result); | ||
| 52 | - } | ||
| 53 | - })); | ||
| 47 | + return handleMainPromise(loadESM((loader) => loader.eval(source))); | ||
| 54 | 48 | } | |
| 55 | 49 | ||
| 56 | 50 | function evalScript(name, body, breakFirstLine, print) { | |
@@ -158,7 +152,7 @@ function createOnGlobalUncaughtException() { | |||
| 158 | 152 | 'Exception', | |
| 159 | 153 | 'Exception', | |
| 160 | 154 | null, | |
| 161 | - er ? er : {}); | ||
| 155 | + er ?? {}); | ||
| 162 | 156 | } | |
| 163 | 157 | } catch {} // Ignore the exception. Diagnostic reporting is unavailable. | |
| 164 | 158 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments