File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,10 @@ const lineSupportFormatter = context => level => msg => {
5555 throw Error ( "logger" ) ;
5656 } catch ( e ) {
5757 const stackFrames = e . stack . split ( "\n" ) ;
58- line = stackFrames [ 5 ] ; // as long as the logger impl. does not chane, the call site is always 5 levels deep in the stack
58+ // Safari has removed the "Error: logger" from the stack frames, while chrome and firefox have it
59+ // Maintainer note: when the test cases fail for a certain browser only, this is likely the culprit
60+ const offset = stackFrames [ 0 ] . match ( "Error" ) ? 1 : 0 ;
61+ line = stackFrames [ 4 + offset ] ; // as long as the logger impl. does not change, the call site is always so deep in the stack
5962 }
6063 return `${ msg } ${ line } ${ context } ${ level } ` ;
6164} ;
You can’t perform that action at this time.
0 commit comments