diff options
author | bcoe <bencoe@google.com> | 2021-02-06 22:11:35 +0300 |
---|---|---|
committer | Danielle Adams <adamzdanielle@gmail.com> | 2021-02-16 17:16:08 +0300 |
commit | 15804e0b3f953b184b21f6136efa4e4a80082c84 (patch) | |
tree | 70d7330d11df67d74f602648e176b409b2f444d9 /test | |
parent | 848718445713fee026edc3d9a389f7b7273fe5e2 (diff) |
errors: align source-map stacks with spec
Reformat stack traces when --enable-source-maps flag is set to format
more likely to fit https://github.com/tc39/proposal-error-stacks
PR-URL: https://github.com/nodejs/node/pull/37252
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ian Sutherland <ian@iansutherland.ca>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/message/source_map_enclosing_function.out | 15 | ||||
-rw-r--r-- | test/message/source_map_reference_error_tabs.out | 6 | ||||
-rw-r--r-- | test/message/source_map_throw_catch.out | 6 | ||||
-rw-r--r-- | test/message/source_map_throw_first_tick.out | 6 | ||||
-rw-r--r-- | test/message/source_map_throw_icu.out | 6 | ||||
-rw-r--r-- | test/message/source_map_throw_set_immediate.out | 6 | ||||
-rw-r--r-- | test/parallel/test-source-map-enable.js | 20 |
7 files changed, 25 insertions, 40 deletions
diff --git a/test/message/source_map_enclosing_function.out b/test/message/source_map_enclosing_function.out index 4cb969dc38b..3eb76ecbbef 100644 --- a/test/message/source_map_enclosing_function.out +++ b/test/message/source_map_enclosing_function.out @@ -3,16 +3,11 @@ ^ Error: an error! - at functionD (*enclosing-call-site-min.js:1:156) - -> (*enclosing-call-site.js:16:17) - at functionC (*enclosing-call-site-min.js:1:97) - -> (*enclosing-call-site.js:10:3) - at functionB (*enclosing-call-site-min.js:1:60) - -> (*enclosing-call-site.js:6:3) - at functionA (*enclosing-call-site-min.js:1:26) - -> (*enclosing-call-site.js:2:3) - at Object.<anonymous> (*enclosing-call-site-min.js:1:199) - -> (*enclosing-call-site.js:24:3) + at functionD (*enclosing-call-site.js:16:17) + at functionC (*enclosing-call-site.js:10:3) + at functionB (*enclosing-call-site.js:6:3) + at functionA (*enclosing-call-site.js:2:3) + at Object.<anonymous> (*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:*) diff --git a/test/message/source_map_reference_error_tabs.out b/test/message/source_map_reference_error_tabs.out index e0adcbc442a..bce1b5f8911 100644 --- a/test/message/source_map_reference_error_tabs.out +++ b/test/message/source_map_reference_error_tabs.out @@ -3,10 +3,8 @@ ^ ReferenceError: alert is not defined - at Object.<anonymous> (*tabs.coffee:39:5) - -> *tabs.coffee:26:2* - at Object.<anonymous> (*tabs.coffee:53:4) - -> *tabs.coffee:1:14* + 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:* diff --git a/test/message/source_map_throw_catch.out b/test/message/source_map_throw_catch.out index 893e75f92bb..95bba5eee3e 100644 --- a/test/message/source_map_throw_catch.out +++ b/test/message/source_map_throw_catch.out @@ -3,10 +3,8 @@ reachable throw Error('an exception'); ^ Error: an exception - at branch (*typescript-throw.js:20:15) - -> *typescript-throw.ts:18:11* - at Object.<anonymous> (*typescript-throw.js:26:1) - -> *typescript-throw.ts:24:1* + 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:*) diff --git a/test/message/source_map_throw_first_tick.out b/test/message/source_map_throw_first_tick.out index 4fc5aae55bf..efa97a1d9f5 100644 --- a/test/message/source_map_throw_first_tick.out +++ b/test/message/source_map_throw_first_tick.out @@ -3,10 +3,8 @@ reachable throw Error('an exception'); ^ Error: an exception - at branch (*typescript-throw.js:20:15) - -> *typescript-throw.ts:18:11* - at Object.<anonymous> (*typescript-throw.js:26:1) - -> *typescript-throw.ts:24:1* + 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:*) diff --git a/test/message/source_map_throw_icu.out b/test/message/source_map_throw_icu.out index ba5e94044cb..78482d73ddf 100644 --- a/test/message/source_map_throw_icu.out +++ b/test/message/source_map_throw_icu.out @@ -3,10 +3,8 @@ ^ Error: an error - at Object.createElement (*icu.js:5:7) - -> *icu.jsx:3:23* - at Object.<anonymous> (*icu.js:8:82) - -> *icu.jsx:9:5* + 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:* diff --git a/test/message/source_map_throw_set_immediate.out b/test/message/source_map_throw_set_immediate.out index 4893b856f0f..c735e23cb95 100644 --- a/test/message/source_map_throw_set_immediate.out +++ b/test/message/source_map_throw_set_immediate.out @@ -3,8 +3,6 @@ ^ Error: goodbye - at *uglify-throw.js:1:43 - -> at Hello *uglify-throw-original.js:5:9* - at Immediate.<anonymous> (*uglify-throw.js:1:60) - -> *uglify-throw-original.js:9:3* + at Hello *uglify-throw-original.js:5:9* + at *uglify-throw-original.js:9:3* at processImmediate (node:internal/timers:*) diff --git a/test/parallel/test-source-map-enable.js b/test/parallel/test-source-map-enable.js index 6435aa99d2c..9df38cba6ca 100644 --- a/test/parallel/test-source-map-enable.js +++ b/test/parallel/test-source-map-enable.js @@ -155,11 +155,11 @@ function nextdir() { require.resolve('../fixtures/source-map/uglify-throw.js') ]); assert.strictEqual( - output.stderr.toString().match(/->.*uglify-throw-original\.js:5:9/), + output.stderr.toString().match(/.*uglify-throw-original\.js:5:9/), null ); assert.strictEqual( - output.stderr.toString().match(/->.*uglify-throw-original\.js:9:3/), + output.stderr.toString().match(/.*uglify-throw-original\.js:9:3/), null ); } @@ -172,11 +172,11 @@ function nextdir() { ]); assert.match( output.stderr.toString(), - /->.*uglify-throw-original\.js:5:9/ + /.*uglify-throw-original\.js:5:9/ ); assert.match( output.stderr.toString(), - /->.*uglify-throw-original\.js:9:3/ + /.*uglify-throw-original\.js:9:3/ ); assert.match(output.stderr.toString(), /at Hello/); } @@ -187,8 +187,8 @@ function nextdir() { '--enable-source-maps', require.resolve('../fixtures/source-map/typescript-throw.js') ]); - assert.ok(output.stderr.toString().match(/->.*typescript-throw\.ts:18:11/)); - assert.ok(output.stderr.toString().match(/->.*typescript-throw\.ts:24:1/)); + assert.ok(output.stderr.toString().match(/.*typescript-throw\.ts:18:11/)); + assert.ok(output.stderr.toString().match(/.*typescript-throw\.ts:24:1/)); } // Applies source-maps generated by babel to stack trace. @@ -198,7 +198,7 @@ function nextdir() { require.resolve('../fixtures/source-map/babel-throw.js') ]); assert.ok( - output.stderr.toString().match(/->.*babel-throw-original\.js:18:31/) + output.stderr.toString().match(/.*babel-throw-original\.js:18:31/) ); } @@ -209,10 +209,10 @@ function nextdir() { require.resolve('../fixtures/source-map/istanbul-throw.js') ]); assert.ok( - output.stderr.toString().match(/->.*istanbul-throw-original\.js:5:9/) + output.stderr.toString().match(/.*istanbul-throw-original\.js:5:9/) ); assert.ok( - output.stderr.toString().match(/->.*istanbul-throw-original\.js:9:3/) + output.stderr.toString().match(/.*istanbul-throw-original\.js:9:3/) ); } @@ -223,7 +223,7 @@ function nextdir() { require.resolve('../fixtures/source-map/babel-esm.mjs') ]); assert.ok( - output.stderr.toString().match(/->.*babel-esm-original\.mjs:9:29/) + output.stderr.toString().match(/.*babel-esm-original\.mjs:9:29/) ); } |