From fc47d58abef8b4509480a43b94d6af857620503a Mon Sep 17 00:00:00 2001 From: Geoffrey Booth <456802+GeoffreyBooth@users.noreply.github.com> Date: Sun, 14 Aug 2022 14:59:02 -0700 Subject: [PATCH] test: remove cjs loader from stack traces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/44197 Backport-PR-URL: https://github.com/nodejs/node/pull/46535 Reviewed-By: Moshe Atlow Reviewed-By: Michaƫl Zasso --- test/message/core_line_numbers.js | 2 ++ test/message/core_line_numbers.out | 6 ----- test/message/error_aggregateTwoErrors.js | 2 ++ test/message/error_aggregateTwoErrors.out | 25 +++--------------- test/message/error_exit.js | 2 ++ test/message/error_exit.out | 8 +----- test/message/error_with_nul.js | 1 + test/message/error_with_nul.out | Bin 561 -> 163 bytes .../events_unhandled_error_common_trace.js | 2 ++ .../events_unhandled_error_common_trace.out | 10 ------- .../events_unhandled_error_nexttick.js | 2 ++ .../events_unhandled_error_nexttick.out | 7 ----- .../events_unhandled_error_sameline.js | 2 ++ .../events_unhandled_error_sameline.out | 9 ------- .../events_unhandled_error_subclass.js | 2 ++ .../events_unhandled_error_subclass.out | 9 ------- test/message/if-error-has-good-stack.js | 2 ++ test/message/if-error-has-good-stack.out | 16 ++--------- test/message/source_map_disabled_by_api.js | 1 + test/message/source_map_disabled_by_api.out | 10 ------- test/message/source_map_enabled_by_api.js | 1 + test/message/source_map_enabled_by_api.out | 10 ------- test/message/source_map_enclosing_function.js | 2 ++ .../message/source_map_enclosing_function.out | 5 ---- test/message/source_map_eval.js | 2 ++ test/message/source_map_eval.out | 8 +----- .../source_map_reference_error_tabs.js | 2 ++ .../source_map_reference_error_tabs.out | 8 ------ test/message/source_map_throw_catch.js | 2 ++ test/message/source_map_throw_catch.out | 8 ------ test/message/source_map_throw_first_tick.js | 2 ++ test/message/source_map_throw_first_tick.out | 8 ------ test/message/source_map_throw_icu.js | 2 ++ test/message/source_map_throw_icu.out | 8 ------ .../throw_error_with_getter_throw_traced.js | 11 -------- test/message/throw_null_traced.js | 6 ----- test/message/throw_undefined_traced.js | 6 ----- .../undefined_reference_in_new_context.js | 2 +- .../undefined_reference_in_new_context.out | 11 +++----- test/message/vm_display_runtime_error.js | 2 ++ test/message/vm_display_runtime_error.out | 12 --------- test/message/vm_display_syntax_error.js | 2 ++ test/message/vm_display_syntax_error.out | 12 --------- test/message/vm_dont_display_runtime_error.js | 2 ++ .../message/vm_dont_display_runtime_error.out | 6 ----- test/message/vm_dont_display_syntax_error.js | 2 ++ test/message/vm_dont_display_syntax_error.out | 6 ----- 47 files changed, 50 insertions(+), 216 deletions(-) delete mode 100644 test/message/throw_error_with_getter_throw_traced.js delete mode 100644 test/message/throw_null_traced.js delete mode 100644 test/message/throw_undefined_traced.js diff --git a/test/message/core_line_numbers.js b/test/message/core_line_numbers.js index 221001ed8952d0..585a6042652df1 100644 --- a/test/message/core_line_numbers.js +++ b/test/message/core_line_numbers.js @@ -1,5 +1,7 @@ 'use strict'; require('../common'); +Error.stackTraceLimit = 3; + const punycode = require('punycode'); // This test verifies that line numbers in core modules are reported correctly. diff --git a/test/message/core_line_numbers.out b/test/message/core_line_numbers.out index 97b017f66e2395..e1f36f1c9c9bc7 100644 --- a/test/message/core_line_numbers.out +++ b/test/message/core_line_numbers.out @@ -6,9 +6,3 @@ RangeError: Invalid input at error (node:punycode:52:8) at Object.decode (node:punycode:*:*) at Object. (*test*message*core_line_numbers.js:*:*) - 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/error_aggregateTwoErrors.js b/test/message/error_aggregateTwoErrors.js index a59a6b5788d4c2..6cb6cce095b295 100644 --- a/test/message/error_aggregateTwoErrors.js +++ b/test/message/error_aggregateTwoErrors.js @@ -2,6 +2,8 @@ 'use strict'; require('../common'); +Error.stackTraceLimit = 1; + const { aggregateTwoErrors } = require('internal/errors'); const originalError = new Error('original'); diff --git a/test/message/error_aggregateTwoErrors.out b/test/message/error_aggregateTwoErrors.out index 02e8738d47f57a..2dac257d48f2de 100644 --- a/test/message/error_aggregateTwoErrors.out +++ b/test/message/error_aggregateTwoErrors.out @@ -1,34 +1,15 @@ *error_aggregateTwoErrors.js:* throw aggregateTwoErrors(err, originalError); ^ -AggregateError: original - at Object. (*test*message*error_aggregateTwoErrors.js:*:*) - 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:*:* { +[AggregateError: original] { code: 'ERR0', [errors]: [ Error: original - at Object. (*test*message*error_aggregateTwoErrors.js:*:*) - 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 Object. (*test*message*error_aggregateTwoErrors.js:*:*) { code: 'ERR0' }, Error: second error - at Object. (*test*message*error_aggregateTwoErrors.js:*:*) - 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 Object. (*test*message*error_aggregateTwoErrors.js:*:*) { code: 'ERR1' } ] diff --git a/test/message/error_exit.js b/test/message/error_exit.js index 057a371df24851..51d303015fd8ac 100644 --- a/test/message/error_exit.js +++ b/test/message/error_exit.js @@ -21,6 +21,8 @@ 'use strict'; require('../common'); +Error.stackTraceLimit = 1; + const assert = require('assert'); process.on('exit', function(code) { diff --git a/test/message/error_exit.out b/test/message/error_exit.out index 2ef95b535dafe7..e0ecbfda640581 100644 --- a/test/message/error_exit.out +++ b/test/message/error_exit.out @@ -7,13 +7,7 @@ AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 1 !== 2 - at Object. (*test*message*error_exit.js:*:*) - 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 Object. (*test*message*error_exit.js:*:*) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 1, diff --git a/test/message/error_with_nul.js b/test/message/error_with_nul.js index 2849e9d21c878c..de49c383fd41a0 100644 --- a/test/message/error_with_nul.js +++ b/test/message/error_with_nul.js @@ -1,5 +1,6 @@ 'use strict'; require('../common'); +Error.stackTraceLimit = 2; function test() { const a = 'abc\0def'; diff --git a/test/message/error_with_nul.out b/test/message/error_with_nul.out index 7fbb33f08e8dc342b9efc899e66f5e3350e9489b..e5f6bdb92b58d8e29c06c61c1b04fcd671450e62 100644 GIT binary patch delta 6 NcmdnUvY2tgVgLw|0*wFw literal 561 zcmbtQJ5R$f5bo?>abuey*$rYVTLlXf0_*BrRY&$2`JuG`o=a#3UP2YO`M%fr!@XVg zbWjbY6q6ZUIU26M9kOl|Ksly30@DcF318#pMz*g?%})(@k%J5tI8iZe!AI+ zcqTsV2ePHTMUH$9vF5u!CA-*HPpz>ryg4rs9DCA^3nfP1g&EGB9dhR*_LOw (*events_unhandled_error_common_trace.js:*:*) - 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:*:* 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:*:*) - [... lines matching original stack trace ...] - at node:internal/main/run_main_module:*:* diff --git a/test/message/events_unhandled_error_nexttick.js b/test/message/events_unhandled_error_nexttick.js index 713031eeefa042..bf508c9788757d 100644 --- a/test/message/events_unhandled_error_nexttick.js +++ b/test/message/events_unhandled_error_nexttick.js @@ -1,5 +1,7 @@ 'use strict'; require('../common'); +Error.stackTraceLimit = 1; + const EventEmitter = require('events'); const er = new Error(); process.nextTick(() => { diff --git a/test/message/events_unhandled_error_nexttick.out b/test/message/events_unhandled_error_nexttick.out index 3e0d4697504e49..7e3ee8a1040d7e 100644 --- a/test/message/events_unhandled_error_nexttick.out +++ b/test/message/events_unhandled_error_nexttick.out @@ -4,12 +4,5 @@ node:events:* Error at Object. (*events_unhandled_error_nexttick.js:*:*) - 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:*:* Emitted 'error' event at: at *events_unhandled_error_nexttick.js:*:* - at processTicksAndRejections (node:internal/process/task_queues:*:*) diff --git a/test/message/events_unhandled_error_sameline.js b/test/message/events_unhandled_error_sameline.js index 1e5e77d08c9919..6dad22dd58e393 100644 --- a/test/message/events_unhandled_error_sameline.js +++ b/test/message/events_unhandled_error_sameline.js @@ -1,4 +1,6 @@ 'use strict'; require('../common'); +Error.stackTraceLimit = 1; + const EventEmitter = require('events'); new EventEmitter().emit('error', new Error()); diff --git a/test/message/events_unhandled_error_sameline.out b/test/message/events_unhandled_error_sameline.out index c027275033941d..4b70d091f61230 100644 --- a/test/message/events_unhandled_error_sameline.out +++ b/test/message/events_unhandled_error_sameline.out @@ -4,14 +4,5 @@ node:events:* Error at Object. (*events_unhandled_error_sameline.js:*:*) - 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:*:* Emitted 'error' event at: at Object. (*events_unhandled_error_sameline.js:*:*) - at Module._compile (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.js b/test/message/events_unhandled_error_subclass.js index 8303cb2237dc1e..5fc3bc26fb4e93 100644 --- a/test/message/events_unhandled_error_subclass.js +++ b/test/message/events_unhandled_error_subclass.js @@ -1,5 +1,7 @@ 'use strict'; require('../common'); +Error.stackTraceLimit = 1; + const EventEmitter = require('events'); class Foo extends EventEmitter {} new Foo().emit('error', new Error()); diff --git a/test/message/events_unhandled_error_subclass.out b/test/message/events_unhandled_error_subclass.out index 5b8131970d50d5..3b8371636a47f8 100644 --- a/test/message/events_unhandled_error_subclass.out +++ b/test/message/events_unhandled_error_subclass.out @@ -4,14 +4,5 @@ node:events:* Error at Object. (*events_unhandled_error_subclass.js:*:*) - 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:*:* Emitted 'error' event on Foo instance at: at Object. (*events_unhandled_error_subclass.js:*:*) - at Module._compile (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.js b/test/message/if-error-has-good-stack.js index 1db25d2fa55a1b..4f529d3e5d17ff 100644 --- a/test/message/if-error-has-good-stack.js +++ b/test/message/if-error-has-good-stack.js @@ -1,6 +1,8 @@ 'use strict'; require('../common'); +Error.stackTraceLimit = 4; + const assert = require('assert'); let err; diff --git a/test/message/if-error-has-good-stack.out b/test/message/if-error-has-good-stack.out index d87581cd767534..a0fcc65d9035d5 100644 --- a/test/message/if-error-has-good-stack.out +++ b/test/message/if-error-has-good-stack.out @@ -10,26 +10,14 @@ AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error at c (*if-error-has-good-stack.js:*:*) 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 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 Object. (*if-error-has-good-stack.js:*:*) { generatedMessage: false, code: 'ERR_ASSERTION', actual: Error: test error at c (*if-error-has-good-stack.js:*:*) 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 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 Object. (*if-error-has-good-stack.js:*:*), expected: null, operator: 'ifError' } diff --git a/test/message/source_map_disabled_by_api.js b/test/message/source_map_disabled_by_api.js index 8405e4f3661cff..a1632565e369a3 100644 --- a/test/message/source_map_disabled_by_api.js +++ b/test/message/source_map_disabled_by_api.js @@ -2,6 +2,7 @@ 'use strict'; require('../common'); +Error.stackTraceLimit = 5; process.setSourceMapsEnabled(false); diff --git a/test/message/source_map_disabled_by_api.out b/test/message/source_map_disabled_by_api.out index d2cca7da5297e3..23db9db86404e3 100644 --- a/test/message/source_map_disabled_by_api.out +++ b/test/message/source_map_disabled_by_api.out @@ -4,11 +4,6 @@ Error: an error! at functionB (*enclosing-call-site-min.js:1:60) at functionA (*enclosing-call-site-min.js:1:26) at Object. (*enclosing-call-site-min.js:1:199) - 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:*) *enclosing-call-site.js:16 throw new Error('an error!') ^ @@ -19,8 +14,3 @@ Error: an error! at functionB (*enclosing-call-site.js:6:3) at functionA (*enclosing-call-site.js:2:3) at Object. (*enclosing-call-site.js:24:3) - 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_enabled_by_api.js b/test/message/source_map_enabled_by_api.js index 3133bd26399fd4..dd995be877fbc9 100644 --- a/test/message/source_map_enabled_by_api.js +++ b/test/message/source_map_enabled_by_api.js @@ -1,5 +1,6 @@ 'use strict'; require('../common'); +Error.stackTraceLimit = 5; process.setSourceMapsEnabled(true); diff --git a/test/message/source_map_enabled_by_api.out b/test/message/source_map_enabled_by_api.out index 525ceccec12e4b..069b35a1a251fb 100644 --- a/test/message/source_map_enabled_by_api.out +++ b/test/message/source_map_enabled_by_api.out @@ -8,11 +8,6 @@ Error: an error! at functionB (*enclosing-call-site.js:6:3) at functionA (*enclosing-call-site.js:2:3) at Object. (*enclosing-call-site.js:24:3) - 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:*) *enclosing-call-site-min.js:1 var functionA=function(){functionB()};function functionB(){functionC()}var functionC=function(){functionD()},functionD=function(){if(0 (*enclosing-call-site-min.js:1:199) - 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_enclosing_function.js b/test/message/source_map_enclosing_function.js index 43b6931bf1e19e..f77bd818f02d78 100644 --- a/test/message/source_map_enclosing_function.js +++ b/test/message/source_map_enclosing_function.js @@ -2,4 +2,6 @@ 'use strict'; require('../common'); +Error.stackTraceLimit = 5; + require('../fixtures/source-map/enclosing-call-site-min.js'); diff --git a/test/message/source_map_enclosing_function.out b/test/message/source_map_enclosing_function.out index 3eb76ecbbef31c..153666a022f90d 100644 --- a/test/message/source_map_enclosing_function.out +++ b/test/message/source_map_enclosing_function.out @@ -8,8 +8,3 @@ Error: an error! at functionB (*enclosing-call-site.js:6:3) at functionA (*enclosing-call-site.js:2:3) at Object. (*enclosing-call-site.js:24:3) - 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_eval.js b/test/message/source_map_eval.js index 534d16bd34c28f..404793f05412e4 100644 --- a/test/message/source_map_eval.js +++ b/test/message/source_map_eval.js @@ -2,6 +2,8 @@ 'use strict'; require('../common'); +Error.stackTraceLimit = 3; + const fs = require('fs'); const content = fs.readFileSync(require.resolve('../fixtures/source-map/tabs.js'), 'utf8'); diff --git a/test/message/source_map_eval.out b/test/message/source_map_eval.out index 7cfd7c84fe6579..b93eaaf1b0a584 100644 --- a/test/message/source_map_eval.out +++ b/test/message/source_map_eval.out @@ -1,10 +1,4 @@ ReferenceError: alert is not defined at Object.eval (*tabs.coffee:26:2) at eval (*tabs.coffee:1:14) - at Object. (*source_map_eval.js:8:1) - 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 Object. (*source_map_eval.js:*:*) diff --git a/test/message/source_map_reference_error_tabs.js b/test/message/source_map_reference_error_tabs.js index f6a39d9d497449..fbe058a5f531bf 100644 --- a/test/message/source_map_reference_error_tabs.js +++ b/test/message/source_map_reference_error_tabs.js @@ -2,4 +2,6 @@ 'use strict'; require('../common'); +Error.stackTraceLimit = 2; + require('../fixtures/source-map/tabs.js'); diff --git a/test/message/source_map_reference_error_tabs.out b/test/message/source_map_reference_error_tabs.out index bce1b5f8911d4b..2a98f50425b5d1 100644 --- a/test/message/source_map_reference_error_tabs.out +++ b/test/message/source_map_reference_error_tabs.out @@ -5,11 +5,3 @@ ReferenceError: alert is not defined at *tabs.coffee:26:2* at *tabs.coffee:1:14* - 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:* - 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.js b/test/message/source_map_throw_catch.js index f3a887474bfbac..603fa81867bcbe 100644 --- a/test/message/source_map_throw_catch.js +++ b/test/message/source_map_throw_catch.js @@ -2,6 +2,8 @@ 'use strict'; require('../common'); +Error.stackTraceLimit = 2; + try { require('../fixtures/source-map/typescript-throw'); } catch (err) { diff --git a/test/message/source_map_throw_catch.out b/test/message/source_map_throw_catch.out index 95bba5eee3e9dc..9cf964e551bc24 100644 --- a/test/message/source_map_throw_catch.out +++ b/test/message/source_map_throw_catch.out @@ -5,11 +5,3 @@ reachable Error: an exception at *typescript-throw.ts:18:11* at *typescript-throw.ts:24:1* - 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:*) - 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.js b/test/message/source_map_throw_first_tick.js index b691b51f355194..9bf1a353cf18be 100644 --- a/test/message/source_map_throw_first_tick.js +++ b/test/message/source_map_throw_first_tick.js @@ -2,4 +2,6 @@ 'use strict'; require('../common'); +Error.stackTraceLimit = 2; + require('../fixtures/source-map/typescript-throw'); diff --git a/test/message/source_map_throw_first_tick.out b/test/message/source_map_throw_first_tick.out index efa97a1d9f56dd..9cf964e551bc24 100644 --- a/test/message/source_map_throw_first_tick.out +++ b/test/message/source_map_throw_first_tick.out @@ -5,11 +5,3 @@ reachable Error: an exception at *typescript-throw.ts:18:11* at *typescript-throw.ts:24:1* - 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:*) - 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.js b/test/message/source_map_throw_icu.js index 00298edc5ed81a..672c1575c6547a 100644 --- a/test/message/source_map_throw_icu.js +++ b/test/message/source_map_throw_icu.js @@ -2,4 +2,6 @@ 'use strict'; require('../common'); +Error.stackTraceLimit = 2; + require('../fixtures/source-map/icu'); diff --git a/test/message/source_map_throw_icu.out b/test/message/source_map_throw_icu.out index 78482d73ddf037..9c01f25c78a278 100644 --- a/test/message/source_map_throw_icu.out +++ b/test/message/source_map_throw_icu.out @@ -5,11 +5,3 @@ Error: an error at *icu.jsx:3:23* at *icu.jsx:9:5* - 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:* - 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.js b/test/message/throw_error_with_getter_throw_traced.js deleted file mode 100644 index 609bd9caf83fe2..00000000000000 --- a/test/message/throw_error_with_getter_throw_traced.js +++ /dev/null @@ -1,11 +0,0 @@ -// Flags: --trace-uncaught -'use strict'; -require('../common'); -throw { // eslint-disable-line no-throw-literal - get stack() { - throw new Error('weird throw but ok'); - }, - get name() { - throw new Error('weird throw but ok'); - }, -}; diff --git a/test/message/throw_null_traced.js b/test/message/throw_null_traced.js deleted file mode 100644 index fee8928f887403..00000000000000 --- a/test/message/throw_null_traced.js +++ /dev/null @@ -1,6 +0,0 @@ -// Flags: --trace-uncaught -'use strict'; -require('../common'); - -// eslint-disable-next-line no-throw-literal -throw null; diff --git a/test/message/throw_undefined_traced.js b/test/message/throw_undefined_traced.js deleted file mode 100644 index f6ded43378dc91..00000000000000 --- a/test/message/throw_undefined_traced.js +++ /dev/null @@ -1,6 +0,0 @@ -// Flags: --trace-uncaught -'use strict'; -require('../common'); - -// eslint-disable-next-line no-throw-literal -throw undefined; diff --git a/test/message/undefined_reference_in_new_context.js b/test/message/undefined_reference_in_new_context.js index 7cb68ec5b3b3df..29a67632f8f7dd 100644 --- a/test/message/undefined_reference_in_new_context.js +++ b/test/message/undefined_reference_in_new_context.js @@ -26,6 +26,6 @@ const vm = require('vm'); console.error('before'); // undefined reference -vm.runInNewContext('foo.bar = 5;'); +vm.runInNewContext('Error.stackTraceLimit = 5; foo.bar = 5;'); console.error('after'); diff --git a/test/message/undefined_reference_in_new_context.out b/test/message/undefined_reference_in_new_context.out index 61dee9f6d4fba3..b393d7f6b25822 100644 --- a/test/message/undefined_reference_in_new_context.out +++ b/test/message/undefined_reference_in_new_context.out @@ -1,16 +1,11 @@ before evalmachine.:1 -foo.bar = 5; -^ +Error.stackTraceLimit = 5; foo.bar = 5; + ^ ReferenceError: foo is not defined - at evalmachine.:1:1 + at evalmachine.:*:* at Script.runInContext (node:vm:*) at Script.runInNewContext (node:vm:*) at Object.runInNewContext (node:vm:*) at Object. (*test*message*undefined_reference_in_new_context.js:*) - 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/vm_display_runtime_error.js b/test/message/vm_display_runtime_error.js index 3ebbb1464d135d..80505cb02f3f3b 100644 --- a/test/message/vm_display_runtime_error.js +++ b/test/message/vm_display_runtime_error.js @@ -21,6 +21,8 @@ 'use strict'; require('../common'); +Error.stackTraceLimit = 4; + const vm = require('vm'); console.error('beginning'); diff --git a/test/message/vm_display_runtime_error.out b/test/message/vm_display_runtime_error.out index 8f1e9c37967f25..bb54dfbbefc4e0 100644 --- a/test/message/vm_display_runtime_error.out +++ b/test/message/vm_display_runtime_error.out @@ -8,12 +8,6 @@ Error: boo! at Script.runInThisContext (node:vm:*) at Object.runInThisContext (node:vm:*) at Object. (*test*message*vm_display_runtime_error.js:*) - 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 +17,3 @@ Error: spooky! at Script.runInThisContext (node:vm:*) at Object.runInThisContext (node:vm:*) at Object. (*test*message*vm_display_runtime_error.js:*) - 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.js b/test/message/vm_display_syntax_error.js index ac9b4d17bd147b..f47d8d477ececc 100644 --- a/test/message/vm_display_syntax_error.js +++ b/test/message/vm_display_syntax_error.js @@ -21,6 +21,8 @@ 'use strict'; require('../common'); +Error.stackTraceLimit = 4; + const vm = require('vm'); console.error('beginning'); diff --git a/test/message/vm_display_syntax_error.out b/test/message/vm_display_syntax_error.out index b0b70fcd759668..b0a5b82aca47a0 100644 --- a/test/message/vm_display_syntax_error.out +++ b/test/message/vm_display_syntax_error.out @@ -7,12 +7,6 @@ SyntaxError: Unexpected number at createScript (node:vm:*) at Object.runInThisContext (node:vm:*) at Object. (*test*message*vm_display_syntax_error.js:*) - 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 +15,3 @@ SyntaxError: Unexpected number at createScript (node:vm:*) at Object.runInThisContext (node:vm:*) at Object. (*test*message*vm_display_syntax_error.js:*) - 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.js b/test/message/vm_dont_display_runtime_error.js index 49203684ed6609..44bdaf42d9b234 100644 --- a/test/message/vm_dont_display_runtime_error.js +++ b/test/message/vm_dont_display_runtime_error.js @@ -21,6 +21,8 @@ 'use strict'; require('../common'); +Error.stackTraceLimit = 4; + const vm = require('vm'); console.error('beginning'); diff --git a/test/message/vm_dont_display_runtime_error.out b/test/message/vm_dont_display_runtime_error.out index 2ff2e8355ab90c..1e0fd6b55d3594 100644 --- a/test/message/vm_dont_display_runtime_error.out +++ b/test/message/vm_dont_display_runtime_error.out @@ -9,9 +9,3 @@ Error: boo! at Script.runInThisContext (node:vm:*) at Object.runInThisContext (node:vm:*) at Object. (*test*message*vm_dont_display_runtime_error.js:*) - 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.js b/test/message/vm_dont_display_syntax_error.js index 38c49ad1a65315..01ab0b6395c69b 100644 --- a/test/message/vm_dont_display_syntax_error.js +++ b/test/message/vm_dont_display_syntax_error.js @@ -21,6 +21,8 @@ 'use strict'; require('../common'); +Error.stackTraceLimit = 4; + const vm = require('vm'); console.error('beginning'); diff --git a/test/message/vm_dont_display_syntax_error.out b/test/message/vm_dont_display_syntax_error.out index d46dce2993f863..1423bbf69c203e 100644 --- a/test/message/vm_dont_display_syntax_error.out +++ b/test/message/vm_dont_display_syntax_error.out @@ -9,9 +9,3 @@ SyntaxError: Unexpected number at createScript (node:vm:*) at Object.runInThisContext (node:vm:*) at Object. (*test*message*vm_dont_display_syntax_error.js:*) - 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:*:*