diff --git a/lib/internal/modules/cjs/helpers.js b/lib/internal/modules/cjs/helpers.js index 163c854ac26d48..600574ea99fd28 100644 --- a/lib/internal/modules/cjs/helpers.js +++ b/lib/internal/modules/cjs/helpers.js @@ -45,12 +45,12 @@ function loadNativeModule(filename, request) { // to use as the context for the require() function. // Use redirects to set up a mapping from a policy and restrict dependencies const urlToFileCache = new SafeMap(); -function makeRequireFunction(mod, redirects) { +function makeRequireFunction(mod, redirects, id) { const Module = mod.constructor; let require; if (redirects) { - const id = mod.filename || mod.id; + id = id || mod.filename || mod.id; const conditions = cjsConditions; const { resolve, reaction } = redirects; require = function require(specifier) { diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js index 5ea435ceaf36ad..32546104093fbf 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -66,6 +66,7 @@ const cjsParseCache = new SafeWeakMap(); // Set first due to cycle with ESM loader functions. module.exports = { wrapSafe, Module, toRealPath, readPackageScope, cjsParseCache, + ModuleCompile, get hasLoadedAnyUserCJSModule() { return hasLoadedAnyUserCJSModule; } }; @@ -849,7 +850,6 @@ Module._resolveFilename = function(request, parent, isMain, options) { StringPrototypeStartsWith(request, '../') || ((isWindows && StringPrototypeStartsWith(request, '.\\')) || StringPrototypeStartsWith(request, '..\\')); - if (isRelative) { paths = options.paths; } else { @@ -899,6 +899,7 @@ Module._resolveFilename = function(request, parent, isMain, options) { // Try module self resoultion first const parentPath = trySelfParentPath(parent); const selfResolved = trySelf(parentPath, request); + if (selfResolved) { const cacheKey = request + '\x00' + (paths.length === 1 ? paths[0] : ArrayPrototypeJoin(paths, '\x00')); @@ -907,7 +908,7 @@ Module._resolveFilename = function(request, parent, isMain, options) { } // Look up the filename first, since that's the cache key. - const filename = Module._findPath(request, paths, isMain, false); + const filename = Module._findPath(request, paths, isMain); if (filename) return filename; const requireStack = []; for (let cursor = parent; @@ -1058,17 +1059,17 @@ function wrapSafe(filename, content, cjsModuleInstance) { // the correct helper variables (require, module, exports) to // the file. // Returns exception, if any. -Module.prototype._compile = function(content, filename) { +function ModuleCompile(module, content, filename, wrapping) { let moduleURL; let redirects; - if (policy?.manifest) { + if (!wrapping && policy?.manifest) { moduleURL = pathToFileURL(filename); redirects = policy.manifest.getDependencyMapper(moduleURL); policy.manifest.assertIntegrity(moduleURL, content); } - maybeCacheSourceMap(filename, content, this); - const compiledWrapper = wrapSafe(filename, content, this); + maybeCacheSourceMap(filename, content, module); + const compiledWrapper = wrapSafe(filename, content, module); let inspectorWrapper = null; if (getOptionValue('--inspect-brk') && process._eval == null) { @@ -1094,11 +1095,10 @@ Module.prototype._compile = function(content, filename) { } } const dirname = path.dirname(filename); - const require = makeRequireFunction(this, redirects); + const require = makeRequireFunction(module, redirects, wrapping); let result; - const exports = this.exports; + const exports = module.exports; const thisValue = exports; - const module = this; if (requireDepth === 0) statCache = new SafeMap(); if (inspectorWrapper) { result = inspectorWrapper(compiledWrapper, thisValue, exports, @@ -1110,6 +1110,9 @@ Module.prototype._compile = function(content, filename) { hasLoadedAnyUserCJSModule = true; if (requireDepth === 0) statCache = null; return result; +} +Module.prototype._compile = function(contents, filename) { + return ModuleCompile(this, contents, filename, null); }; // Native extension for .js diff --git a/lib/internal/process/execution.js b/lib/internal/process/execution.js index 314b8b0a03c161..80c7b7bfcd02ba 100644 --- a/lib/internal/process/execution.js +++ b/lib/internal/process/execution.js @@ -50,7 +50,10 @@ function evalModule(source, print) { } function evalScript(name, body, breakFirstLine, print) { - const CJSModule = require('internal/modules/cjs/loader').Module; + const { + Module: CJSModule, + ModuleCompile + } = require('internal/modules/cjs/loader'); const { kVmBreakFirstLineSymbol } = require('internal/util'); const { pathToFileURL } = require('url'); @@ -62,7 +65,12 @@ function evalScript(name, body, breakFirstLine, print) { module.paths = CJSModule._nodeModulePaths(cwd); const asyncESM = require('internal/process/esm_loader'); - const baseUrl = pathToFileURL(module.filename).href; + const baseHREF = pathToFileURL(module.filename).href; + const { getOptionValue } = require('internal/options'); + const policy = getOptionValue('--experimental-policy') ? + require('internal/process/policy') : + null; + policy?.assertIntegrity(baseHREF, body); // Create wrapper for cache entry const script = ` @@ -73,16 +81,19 @@ function evalScript(name, body, breakFirstLine, print) { return (main) => main(); `; globalThis.__filename = name; - const result = module._compile(script, `${name}-wrapper`)(() => - require('vm').runInThisContext(body, { - filename: name, - displayErrors: true, - [kVmBreakFirstLineSymbol]: !!breakFirstLine, - async importModuleDynamically(specifier) { - const loader = await asyncESM.ESMLoader; - return loader.import(specifier, baseUrl); - } - })); + const result = ModuleCompile(module, script, `${name}-wrapper`, baseHREF)( + () => { + return require('vm').runInThisContext(body, { + filename: name, + displayErrors: true, + [kVmBreakFirstLineSymbol]: !!breakFirstLine, + async importModuleDynamically(specifier) { + const loader = await asyncESM.ESMLoader; + return loader.import(specifier, baseHREF); + } + }); + } + ); if (print) { const { log } = require('internal/console/global'); log(result); diff --git a/test/message/assert_throws_stack.out b/test/message/assert_throws_stack.out index 6841630d03b195..1cc0cf6c82156a 100644 --- a/test/message/assert_throws_stack.out +++ b/test/message/assert_throws_stack.out @@ -15,6 +15,7 @@ AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal: at * at * at * + at * at * { generatedMessage: true, code: 'ERR_ASSERTION', diff --git a/test/message/console.out b/test/message/console.out index 57d56028663120..64814bd7a0d889 100644 --- a/test/message/console.out +++ b/test/message/console.out @@ -6,3 +6,4 @@ Trace: foo at * at * at * + at * diff --git a/test/message/core_line_numbers.out b/test/message/core_line_numbers.out index 215542404be02f..0c309f2a142907 100644 --- a/test/message/core_line_numbers.out +++ b/test/message/core_line_numbers.out @@ -6,6 +6,7 @@ RangeError: Invalid input at error (node:punycode:42:8) at Object.decode (node:punycode:*:*) at Object. (*test*message*core_line_numbers.js:*:*) + at ModuleCompile (node:internal/modules/cjs/loader:*:*) at Module._compile (node:internal/modules/cjs/loader:*:*) at Object.Module._extensions..js (node:internal/modules/cjs/loader:*:*) at Module.load (node:internal/modules/cjs/loader:*:*) diff --git a/test/message/error_exit.out b/test/message/error_exit.out index 2ef95b535dafe7..6867a73d4d359c 100644 --- a/test/message/error_exit.out +++ b/test/message/error_exit.out @@ -8,6 +8,7 @@ AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 1 !== 2 at Object. (*test*message*error_exit.js:*:*) + at ModuleCompile (node:internal/modules/cjs/loader:*:*) at Module._compile (node:internal/modules/cjs/loader:*:*) at Object.Module._extensions..js (node:internal/modules/cjs/loader:*:*) at Module.load (node:internal/modules/cjs/loader:*:*) diff --git a/test/message/error_with_nul.out b/test/message/error_with_nul.out index 7fbb33f08e8dc3..e9af1056d94b34 100644 Binary files a/test/message/error_with_nul.out and b/test/message/error_with_nul.out differ diff --git a/test/message/events_unhandled_error_common_trace.out b/test/message/events_unhandled_error_common_trace.out index 19e89869ba74fa..40205c859d536f 100644 --- a/test/message/events_unhandled_error_common_trace.out +++ b/test/message/events_unhandled_error_common_trace.out @@ -6,6 +6,7 @@ Error: foo:bar at bar (*events_unhandled_error_common_trace.js:*:*) at foo (*events_unhandled_error_common_trace.js:*:*) at Object. (*events_unhandled_error_common_trace.js:*:*) + at ModuleCompile (node:internal/modules/cjs/loader:*:*) at Module._compile (node:internal/modules/cjs/loader:*:*) at Object.Module._extensions..js (node:internal/modules/cjs/loader:*:*) at Module.load (node:internal/modules/cjs/loader:*:*) @@ -15,6 +16,6 @@ Error: foo:bar Emitted 'error' event at: at quux (*events_unhandled_error_common_trace.js:*:*) at Object. (*events_unhandled_error_common_trace.js:*:*) - at Module._compile (node:internal/modules/cjs/loader:*:*) + at ModuleCompile (node:internal/modules/cjs/loader:*:*) [... lines matching original stack trace ...] at node:internal/main/run_main_module:*:* diff --git a/test/message/events_unhandled_error_nexttick.out b/test/message/events_unhandled_error_nexttick.out index 3e0d4697504e49..ce18bc52fc0949 100644 --- a/test/message/events_unhandled_error_nexttick.out +++ b/test/message/events_unhandled_error_nexttick.out @@ -4,6 +4,7 @@ node:events:* Error at Object. (*events_unhandled_error_nexttick.js:*:*) + at ModuleCompile (node:internal/modules/cjs/loader:*:*) at Module._compile (node:internal/modules/cjs/loader:*:*) at Object.Module._extensions..js (node:internal/modules/cjs/loader:*:*) at Module.load (node:internal/modules/cjs/loader:*:*) diff --git a/test/message/events_unhandled_error_sameline.out b/test/message/events_unhandled_error_sameline.out index c027275033941d..a72d8419f427e6 100644 --- a/test/message/events_unhandled_error_sameline.out +++ b/test/message/events_unhandled_error_sameline.out @@ -4,6 +4,7 @@ node:events:* Error at Object. (*events_unhandled_error_sameline.js:*:*) + at ModuleCompile (node:internal/modules/cjs/loader:*:*) at Module._compile (node:internal/modules/cjs/loader:*:*) at Object.Module._extensions..js (node:internal/modules/cjs/loader:*:*) at Module.load (node:internal/modules/cjs/loader:*:*) @@ -12,6 +13,6 @@ Error at node:internal/main/run_main_module:*:* Emitted 'error' event at: at Object. (*events_unhandled_error_sameline.js:*:*) - at Module._compile (node:internal/modules/cjs/loader:*:*) + at ModuleCompile (node:internal/modules/cjs/loader:*:*) [... lines matching original stack trace ...] at node:internal/main/run_main_module:*:* diff --git a/test/message/events_unhandled_error_subclass.out b/test/message/events_unhandled_error_subclass.out index 5b8131970d50d5..ab26da8a0d45f6 100644 --- a/test/message/events_unhandled_error_subclass.out +++ b/test/message/events_unhandled_error_subclass.out @@ -4,6 +4,7 @@ node:events:* Error at Object. (*events_unhandled_error_subclass.js:*:*) + at ModuleCompile (node:internal/modules/cjs/loader:*:*) at Module._compile (node:internal/modules/cjs/loader:*:*) at Object.Module._extensions..js (node:internal/modules/cjs/loader:*:*) at Module.load (node:internal/modules/cjs/loader:*:*) @@ -12,6 +13,6 @@ Error at node:internal/main/run_main_module:*:* Emitted 'error' event on Foo instance at: at Object. (*events_unhandled_error_subclass.js:*:*) - at Module._compile (node:internal/modules/cjs/loader:*:*) + at ModuleCompile (node:internal/modules/cjs/loader:*:*) [... lines matching original stack trace ...] at node:internal/main/run_main_module:*:* diff --git a/test/message/if-error-has-good-stack.out b/test/message/if-error-has-good-stack.out index d87581cd767534..60516a57e24634 100644 --- a/test/message/if-error-has-good-stack.out +++ b/test/message/if-error-has-good-stack.out @@ -11,12 +11,12 @@ AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error at b (*if-error-has-good-stack.js:*:*) at a (*if-error-has-good-stack.js:*:*) at Object. (*if-error-has-good-stack.js:*:*) + at ModuleCompile (node:internal/modules/cjs/loader:*:*) at Module._compile (node:internal/modules/cjs/loader:*:*) at Object.Module._extensions..js (node:internal/modules/cjs/loader:*:*) at Module.load (node:internal/modules/cjs/loader:*:*) at Function.Module._load (node:internal/modules/cjs/loader:*:*) - at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:*:*) - at node:internal/main/run_main_module:*:* { + at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:*:*) { generatedMessage: false, code: 'ERR_ASSERTION', actual: Error: test error @@ -24,12 +24,12 @@ AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error at b (*if-error-has-good-stack.js:*:*) at a (*if-error-has-good-stack.js:*:*) at Object. (*if-error-has-good-stack.js:*:*) + at ModuleCompile (node:internal/modules/cjs/loader:*:*) at Module._compile (node:internal/modules/cjs/loader:*:*) at Object.Module._extensions..js (node:internal/modules/cjs/loader:*:*) at Module.load (node:internal/modules/cjs/loader:*:*) at Function.Module._load (node:internal/modules/cjs/loader:*:*) - at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:*:*) - at node:internal/main/run_main_module:*:* + at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:*:*), expected: null, operator: 'ifError' } diff --git a/test/message/internal_assert.out b/test/message/internal_assert.out index 131eb6584853cf..46618b734a6282 100644 --- a/test/message/internal_assert.out +++ b/test/message/internal_assert.out @@ -13,6 +13,7 @@ Please open an issue with this stack trace at https://github.com/nodejs/node/iss at * at * at * + at * at * { code: 'ERR_INTERNAL_ASSERTION' } diff --git a/test/message/internal_assert_fail.out b/test/message/internal_assert_fail.out index f3e2446ab14547..560d91dec0b8e9 100644 --- a/test/message/internal_assert_fail.out +++ b/test/message/internal_assert_fail.out @@ -14,6 +14,7 @@ Please open an issue with this stack trace at https://github.com/nodejs/node/iss at * at * at * + at * at * { code: 'ERR_INTERNAL_ASSERTION' } diff --git a/test/message/promise_always_throw_unhandled.out b/test/message/promise_always_throw_unhandled.out index 8d030268565355..4411429a0d343d 100644 --- a/test/message/promise_always_throw_unhandled.out +++ b/test/message/promise_always_throw_unhandled.out @@ -11,3 +11,4 @@ Error: One at * at * at * + at * diff --git a/test/message/promise_unhandled_warn_with_error.out b/test/message/promise_unhandled_warn_with_error.out index 66c98c57f71717..dadbe5252213e7 100644 --- a/test/message/promise_unhandled_warn_with_error.out +++ b/test/message/promise_unhandled_warn_with_error.out @@ -6,5 +6,6 @@ at * at * at * + at * (Use `* --trace-warnings ...` to show where the warning was created) *UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) \ No newline at end of file diff --git a/test/message/source_map_enclosing_function.out b/test/message/source_map_enclosing_function.out index 4cb969dc38bf38..60ceee49f0367a 100644 --- a/test/message/source_map_enclosing_function.out +++ b/test/message/source_map_enclosing_function.out @@ -13,8 +13,8 @@ Error: an error! -> (*enclosing-call-site.js:2:3) at Object. (*enclosing-call-site-min.js:1:199) -> (*enclosing-call-site.js:24:3) + at ModuleCompile (node:internal/modules/cjs/loader:*) at Module._compile (node:internal/modules/cjs/loader:*) at Object.Module._extensions..js (node:internal/modules/cjs/loader:*) at Module.load (node:internal/modules/cjs/loader:*) at Function.Module._load (node:internal/modules/cjs/loader:*) - at Module.require (node:internal/modules/cjs/loader:*) diff --git a/test/message/source_map_reference_error_tabs.out b/test/message/source_map_reference_error_tabs.out index e0adcbc442aeef..6d3dc0fd51a3f4 100644 --- a/test/message/source_map_reference_error_tabs.out +++ b/test/message/source_map_reference_error_tabs.out @@ -7,6 +7,7 @@ ReferenceError: alert is not defined -> *tabs.coffee:26:2* at Object. (*tabs.coffee:53:4) -> *tabs.coffee:1:14* + at ModuleCompile (node:internal/modules/cjs/loader:* at Module._compile (node:internal/modules/cjs/loader:* at Object.Module._extensions..js (node:internal/modules/cjs/loader:* at Module.load (node:internal/modules/cjs/loader:* @@ -14,4 +15,3 @@ ReferenceError: alert is not defined at Module.require (node:internal/modules/cjs/loader:* at require (node:internal/modules/cjs/helpers:* at Object. (*source_map_reference_error_tabs.js:* - at Module._compile (node:internal/modules/cjs/loader:* diff --git a/test/message/source_map_throw_catch.out b/test/message/source_map_throw_catch.out index 893e75f92bbf5c..9aa4579747c8ea 100644 --- a/test/message/source_map_throw_catch.out +++ b/test/message/source_map_throw_catch.out @@ -7,6 +7,7 @@ Error: an exception -> *typescript-throw.ts:18:11* at Object. (*typescript-throw.js:26:1) -> *typescript-throw.ts:24:1* + at ModuleCompile (node:internal/modules/cjs/loader:*) at Module._compile (node:internal/modules/cjs/loader:*) at Object.Module._extensions..js (node:internal/modules/cjs/loader:*) at Module.load (node:internal/modules/cjs/loader:*) @@ -14,4 +15,3 @@ Error: an exception at Module.require (node:internal/modules/cjs/loader:*) at require (node:internal/modules/cjs/helpers:*) at Object. (*source_map_throw_catch.js:6:3) - at Module._compile (node:internal/modules/cjs/loader:*) diff --git a/test/message/source_map_throw_first_tick.out b/test/message/source_map_throw_first_tick.out index 4fc5aae55bf169..25b6b1ae13499e 100644 --- a/test/message/source_map_throw_first_tick.out +++ b/test/message/source_map_throw_first_tick.out @@ -7,6 +7,7 @@ Error: an exception -> *typescript-throw.ts:18:11* at Object. (*typescript-throw.js:26:1) -> *typescript-throw.ts:24:1* + at ModuleCompile (node:internal/modules/cjs/loader:*) at Module._compile (node:internal/modules/cjs/loader:*) at Object.Module._extensions..js (node:internal/modules/cjs/loader:*) at Module.load (node:internal/modules/cjs/loader:*) @@ -14,4 +15,3 @@ Error: an exception at Module.require (node:internal/modules/cjs/loader:*) at require (node:internal/modules/cjs/helpers:*) at Object. (*source_map_throw_first_tick.js:5:1) - at Module._compile (node:internal/modules/cjs/loader:*) diff --git a/test/message/source_map_throw_icu.out b/test/message/source_map_throw_icu.out index ba5e94044cb2ed..00d82b570ef632 100644 --- a/test/message/source_map_throw_icu.out +++ b/test/message/source_map_throw_icu.out @@ -7,6 +7,7 @@ Error: an error -> *icu.jsx:3:23* at Object. (*icu.js:8:82) -> *icu.jsx:9:5* + at ModuleCompile (node:internal/modules/cjs/loader:*) at Module._compile (node:internal/modules/cjs/loader:* at Object.Module._extensions..js (node:internal/modules/cjs/loader:* at Module.load (node:internal/modules/cjs/loader:* @@ -14,4 +15,3 @@ Error: an error at Module.require (node:internal/modules/cjs/loader:* at require (node:internal/modules/cjs/helpers:* at Object. (*source_map_throw_icu.js:* - at Module._compile (node:internal/modules/cjs/loader:* diff --git a/test/message/throw_error_with_getter_throw_traced.out b/test/message/throw_error_with_getter_throw_traced.out index f5106b8c3fc00b..4a7acdf30ad74d 100644 --- a/test/message/throw_error_with_getter_throw_traced.out +++ b/test/message/throw_error_with_getter_throw_traced.out @@ -5,6 +5,7 @@ throw { // eslint-disable-line no-throw-literal [object Object] Thrown at: at *throw_error_with_getter_throw_traced.js:*:* + at ModuleCompile (node:internal/modules/cjs/loader:*) at Module._compile (node:internal/modules/cjs/loader:*:*) at Module._extensions..js (node:internal/modules/cjs/loader:*:*) at Module.load (node:internal/modules/cjs/loader:*:*) diff --git a/test/message/throw_null_traced.out b/test/message/throw_null_traced.out index e1b471827f449a..c1c68bbcea48a0 100644 --- a/test/message/throw_null_traced.out +++ b/test/message/throw_null_traced.out @@ -5,6 +5,7 @@ throw null; null Thrown at: at *throw_null_traced.js:*:* + at ModuleCompile (node:internal/modules/cjs/loader:*) at Module._compile (node:internal/modules/cjs/loader:*:*) at Module._extensions..js (node:internal/modules/cjs/loader:*:*) at Module.load (node:internal/modules/cjs/loader:*:*) diff --git a/test/message/throw_undefined_traced.out b/test/message/throw_undefined_traced.out index fa89312ed4d9cf..667604a208bd8e 100644 --- a/test/message/throw_undefined_traced.out +++ b/test/message/throw_undefined_traced.out @@ -5,6 +5,7 @@ throw undefined; undefined Thrown at: at *throw_undefined_traced.js:*:* + at ModuleCompile (node:internal/modules/cjs/loader:*) at Module._compile (node:internal/modules/cjs/loader:*:*) at Module._extensions..js (node:internal/modules/cjs/loader:*:*) at Module.load (node:internal/modules/cjs/loader:*:*) diff --git a/test/message/undefined_reference_in_new_context.out b/test/message/undefined_reference_in_new_context.out index 61dee9f6d4fba3..6abbf8c76403ff 100644 --- a/test/message/undefined_reference_in_new_context.out +++ b/test/message/undefined_reference_in_new_context.out @@ -9,8 +9,8 @@ ReferenceError: foo is not defined at Script.runInNewContext (node:vm:*) at Object.runInNewContext (node:vm:*) at Object. (*test*message*undefined_reference_in_new_context.js:*) + at ModuleCompile (node:internal/modules/cjs/loader:*) at Module._compile (node:internal/modules/cjs/loader:*) at *..js (node:internal/modules/cjs/loader:*) at Module.load (node:internal/modules/cjs/loader:*) at Function.Module._load (node:internal/modules/cjs/loader:*:*) - at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:*:*) diff --git a/test/message/unhandled_promise_trace_warnings.out b/test/message/unhandled_promise_trace_warnings.out index a8717d0e13d1e4..ebbcc42f5af72c 100644 --- a/test/message/unhandled_promise_trace_warnings.out +++ b/test/message/unhandled_promise_trace_warnings.out @@ -9,6 +9,7 @@ at * at * at * + at * (node:*) Error: This was rejected at * (*test*message*unhandled_promise_trace_warnings.js:*) at * @@ -17,6 +18,7 @@ at * at * at * + at * (node:*) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1) at handledRejection (node:internal/process/promises:*) at promiseRejectHandler (node:internal/process/promises:*) diff --git a/test/message/util_inspect_error.out b/test/message/util_inspect_error.out index 644ccd58831ef7..31b65eb2e2bf3c 100644 --- a/test/message/util_inspect_error.out +++ b/test/message/util_inspect_error.out @@ -8,6 +8,7 @@ at * at * at * + at * nested: { err: Error: foo @@ -19,6 +20,7 @@ at * at * at * + at * { err: Error: foo bar @@ -29,6 +31,7 @@ at * at * at * + at * nested: { err: Error: foo bar @@ -39,6 +42,7 @@ at * at * at * + at * } } { Error: foo @@ -50,4 +54,5 @@ bar at * at * at * + at * foo: 'bar' } diff --git a/test/message/vm_display_runtime_error.out b/test/message/vm_display_runtime_error.out index 8f1e9c37967f25..f3e639398b4e2b 100644 --- a/test/message/vm_display_runtime_error.out +++ b/test/message/vm_display_runtime_error.out @@ -8,12 +8,12 @@ Error: boo! at Script.runInThisContext (node:vm:*) at Object.runInThisContext (node:vm:*) at Object. (*test*message*vm_display_runtime_error.js:*) + at ModuleCompile (node:internal/modules/cjs/loader:*) at Module._compile (node:internal/modules/cjs/loader:*) at Object.Module._extensions..js (node:internal/modules/cjs/loader:*) at Module.load (node:internal/modules/cjs/loader:*) at Function.Module._load (node:internal/modules/cjs/loader:*) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:*) - at node:internal/main/run_main_module:*:* test.vm:1 throw new Error("spooky!") ^ @@ -23,9 +23,9 @@ Error: spooky! at Script.runInThisContext (node:vm:*) at Object.runInThisContext (node:vm:*) at Object. (*test*message*vm_display_runtime_error.js:*) + at ModuleCompile (node:internal/modules/cjs/loader:*) at Module._compile (node:internal/modules/cjs/loader:*) at Object.Module._extensions..js (node:internal/modules/cjs/loader:*) at Module.load (node:internal/modules/cjs/loader:*) at Function.Module._load (node:internal/modules/cjs/loader:*) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:*) - at node:internal/main/run_main_module:*:* diff --git a/test/message/vm_display_syntax_error.out b/test/message/vm_display_syntax_error.out index b0b70fcd759668..49492ed263dae0 100644 --- a/test/message/vm_display_syntax_error.out +++ b/test/message/vm_display_syntax_error.out @@ -7,12 +7,12 @@ SyntaxError: Unexpected number at createScript (node:vm:*) at Object.runInThisContext (node:vm:*) at Object. (*test*message*vm_display_syntax_error.js:*) + at ModuleCompile (node:internal/modules/cjs/loader:*) at Module._compile (node:internal/modules/cjs/loader:*) at Object.Module._extensions..js (node:internal/modules/cjs/loader:*) at Module.load (node:internal/modules/cjs/loader:*) at Function.Module._load (node:internal/modules/cjs/loader:*) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:*) - at node:internal/main/run_main_module:*:* test.vm:1 var 5; ^ @@ -21,9 +21,9 @@ SyntaxError: Unexpected number at createScript (node:vm:*) at Object.runInThisContext (node:vm:*) at Object. (*test*message*vm_display_syntax_error.js:*) + at ModuleCompile (node:internal/modules/cjs/loader:*) at Module._compile (node:internal/modules/cjs/loader:*) at Object.Module._extensions..js (node:internal/modules/cjs/loader:*) at Module.load (node:internal/modules/cjs/loader:*) at Function.Module._load (node:internal/modules/cjs/loader:*) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:*) - at node:internal/main/run_main_module:*:* diff --git a/test/message/vm_dont_display_runtime_error.out b/test/message/vm_dont_display_runtime_error.out index 2ff2e8355ab90c..142c9a5759c830 100644 --- a/test/message/vm_dont_display_runtime_error.out +++ b/test/message/vm_dont_display_runtime_error.out @@ -9,9 +9,9 @@ Error: boo! at Script.runInThisContext (node:vm:*) at Object.runInThisContext (node:vm:*) at Object. (*test*message*vm_dont_display_runtime_error.js:*) + at ModuleCompile (node:internal/modules/cjs/loader:*) at Module._compile (node:internal/modules/cjs/loader:*) at Object.Module._extensions..js (node:internal/modules/cjs/loader:*) at Module.load (node:internal/modules/cjs/loader:*) at Function.Module._load (node:internal/modules/cjs/loader:*) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:*) - at node:internal/main/run_main_module:*:* diff --git a/test/message/vm_dont_display_syntax_error.out b/test/message/vm_dont_display_syntax_error.out index d46dce2993f863..5fc9ba54c46fdc 100644 --- a/test/message/vm_dont_display_syntax_error.out +++ b/test/message/vm_dont_display_syntax_error.out @@ -9,9 +9,9 @@ SyntaxError: Unexpected number at createScript (node:vm:*) at Object.runInThisContext (node:vm:*) at Object. (*test*message*vm_dont_display_syntax_error.js:*) + at ModuleCompile (node:internal/modules/cjs/loader:*) at Module._compile (node:internal/modules/cjs/loader:*) at Object.Module._extensions..js (node:internal/modules/cjs/loader:*) at Module.load (node:internal/modules/cjs/loader:*) at Function.Module._load (node:internal/modules/cjs/loader:*) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:*) - at node:internal/main/run_main_module:*:* diff --git a/test/pseudo-tty/console_colors.out b/test/pseudo-tty/console_colors.out index 8766302ffd7e51..e8f311456e6a42 100644 --- a/test/pseudo-tty/console_colors.out +++ b/test/pseudo-tty/console_colors.out @@ -7,6 +7,7 @@ Error: test foobar at * (*console_colors.js:*:*) *[90m at * (node:internal*:*:*)*[39m +*[90m at * (node:internal*:*:*)*[39m *[90m at *[39m *[90m at *[39m *[90m at *[39m @@ -15,6 +16,7 @@ foobar Error: Should not ever get here. at * (*node_modules*[4m*node_modules*[24m*bar.js:*:*) +*[90m at * (node:internal*:*:*)*[39m *[90m at *[39m *[90m at *[39m *[90m at *[39m @@ -22,15 +24,14 @@ Error: Should not ever get here. *[90m at *[39m *[90m at *[39m at * (*console_colors.js:*:*) -*[90m at *[39m -*[90m at *[39m +*[90m at * (node:internal*:*:*)*[39m Error at evalmachine.:*:* *[90m at Script.runInThisContext (node:vm:*:*)*[39m *[90m at Object.runInThisContext (node:vm:*:*)*[39m at * (*console_colors.js:*:*) -*[90m at *[39m +*[90m at * (node:internal*:*:*)*[39m *[90m at *[39m *[90m at *[39m *[90m at *[39m diff --git a/test/pseudo-tty/test-fatal-error.out b/test/pseudo-tty/test-fatal-error.out index b6eeca17f55246..30187bbd90cb6a 100644 --- a/test/pseudo-tty/test-fatal-error.out +++ b/test/pseudo-tty/test-fatal-error.out @@ -8,6 +8,7 @@ TypeError: foobar *[90m at *(node:internal*loader:*:*)*[39m *[90m at *(node:internal*loader:*:*)*[39m *[90m at *(node:internal*loader:*:*)*[39m +*[90m at *(node:internal*loader:*:*)*[39m *[90m at *[39m *[90m at *[39m { bla: *[33mtrue*[39m diff --git a/test/pseudo-tty/test-trace-sigint.out b/test/pseudo-tty/test-trace-sigint.out index 956cbafccc2d19..ae6063b74242e4 100644 --- a/test/pseudo-tty/test-trace-sigint.out +++ b/test/pseudo-tty/test-trace-sigint.out @@ -7,3 +7,4 @@ KEYBOARD_INTERRUPT: Script execution was interrupted by `SIGINT` at * at * at * + at *