File tree Expand file tree Collapse file tree 3 files changed +15
-9
lines changed
Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,7 @@ export class ConsoleFormatter {
177177 '### Stack trace' ,
178178 this . #formatFragment( stackTrace . syncFragment ) ,
179179 ...stackTrace . asyncFragments . map ( this . #formatAsyncFragment. bind ( this ) ) ,
180+ 'Note: line and column numbers use 1-based indexing' ,
180181 ] . join ( '\n' ) ;
181182 }
182183
@@ -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 @@ -22,6 +22,7 @@ at foo (foo.ts:10:2)
2222at bar (foo.ts:20:2)
2323--- setTimeout -------------------------
2424at schedule (util.ts:5:2)
25+ Note: line and column numbers use 1-based indexing
2526`;
2627
2728exports[`ConsoleFormatter > toStringDetailed > formats a console.error message 1`] = `
@@ -57,6 +58,7 @@ at foo (foo.ts:10:2)
5758at bar (foo.ts:20:2)
5859--- setTimeout -------------------------
5960at schedule (util.ts:5:2)
61+ Note: line and column numbers use 1-based indexing
6062`;
6163
6264exports[`ConsoleFormatter > toStringDetailed > handles \"Execution context is not available\" error in args 1`] = `
Original file line number Diff line number Diff line change @@ -5,21 +5,23 @@ 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)
12+ Note: line and column numbers use 1-based indexing
1213`;
1314
1415exports[`console > get_console_message > applies source maps to stack traces of uncaught exceptions 1`] = `
1516# test response
1617ID: 1
1718Message: error> Uncaught Error: b00m!
1819### 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)
20+ at bar (main.js:3:9)
21+ at foo (main.js:7:3)
22+ at Iife (main.js:11:3)
23+ at <anonymous> (main.js:10:1)
24+ Note: line and column numbers use 1-based indexing
2325`;
2426
2527exports[`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