File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed
Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,7 @@ export class ConsoleFormatter {
175175
176176 return [
177177 '### Stack trace' ,
178+ 'Note: line and column numbers use 1-based indexing' ,
178179 this . #formatFragment( stackTrace . syncFragment ) ,
179180 ...stackTrace . asyncFragments . map ( this . #formatAsyncFragment. bind ( this ) ) ,
180181 ] . join ( '\n' ) ;
@@ -198,7 +199,8 @@ export class ConsoleFormatter {
198199 #formatFrame( frame : DevTools . DevTools . StackTrace . StackTrace . Frame ) : string {
199200 let result = `at ${ frame . name ?? '<anonymous>' } ` ;
200201 if ( frame . uiSourceCode ) {
201- result += ` (${ frame . uiSourceCode . displayName ( ) } :${ frame . line } :${ frame . column } )` ;
202+ const location = frame . uiSourceCode . uiLocation ( frame . line , frame . column ) ;
203+ result += ` (${ location . linkText ( /* skipTrim */ false , /* showColumnNumber */ true ) } )` ;
202204 } else if ( frame . url ) {
203205 result += ` (${ frame . url } :${ frame . line } :${ frame . column } )` ;
204206 }
Original file line number Diff line number Diff line change @@ -5,21 +5,21 @@ Message: warn> hello world
55### Arguments
66Arg #0: hello world
77### Stack trace
8- at bar (main.js:2:10 )
9- at foo (main.js:6:2 )
10- at Iife (main.js:10:2 )
11- at <anonymous> (main.js:9:0 )
8+ at bar (main.js:3:11 )
9+ at foo (main.js:7:3 )
10+ at Iife (main.js:11:3 )
11+ at <anonymous> (main.js:10:1 )
1212`;
1313
1414exports[`console > get_console_message > applies source maps to stack traces of uncaught exceptions 1`] = `
1515# test response
1616ID: 1
1717Message: error> Uncaught Error: b00m!
1818### Stack trace
19- at bar (main.js:2:8 )
20- at foo (main.js:6:2 )
21- at Iife (main.js:10:2 )
22- at <anonymous> (main.js:9:0 )
19+ at bar (main.js:3:9 )
20+ at foo (main.js:7:3 )
21+ at Iife (main.js:11:3 )
22+ at <anonymous> (main.js:10:1 )
2323`;
2424
2525exports[`console > get_console_message > issues type > gets issue details with node id parsing 1`] = `
You can’t perform that action at this time.
0 commit comments