File tree Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ const chrome = /^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|addre
4646// gecko regex: `(?:bundle|\d+\.js)`: `bundle` is for react native, `\d+\.js` also but specifically for ram bundles because it
4747// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js
4848// We need this specific case for now because we want no other regex to match.
49- const gecko = / ^ \s * ( .* ?) (?: \( ( .* ?) \) ) ? (?: ^ | @ ) ? ( (?: f i l e | h t t p s ? | b l o b | c h r o m e | w e b p a c k | r e s o u r c e | m o z - e x t e n s i o n | c a p a c i t o r ) . * ?: \/ .* ?| \[ n a t i v e c o d e \] | [ ^ @ ] * (?: b u n d l e | \d + \. j s ) | \/ [ \w \- . / = ] + ) (?: : ( \d + ) ) ? (?: : ( \d + ) ) ? \s * $ / i;
49+ const gecko = / ^ \s * ( .* ?) (?: \( ( .* ?) \) ) ? (?: ^ | @ ) ? ( (?: f i l e | h t t p s ? | b l o b | c h r o m e | w e b p a c k | r e s o u r c e | m o z - e x t e n s i o n | s a f a r i - e x t e n s i o n | s a f a r i - w e b - e x t e n s i o n | c a p a c i t o r ) ? : \/ .* ?| \[ n a t i v e c o d e \] | [ ^ @ ] * (?: b u n d l e | \d + \. j s ) | \/ [ \w \- . / = ] + ) (?: : ( \d + ) ) ? (?: : ( \d + ) ) ? \s * $ / i;
5050const winjs = / ^ \s * a t (?: ( (?: \[ o b j e c t o b j e c t \] ) ? .+ ) ) ? \( ? ( (?: f i l e | m s - a p p x | h t t p s ? | w e b p a c k | b l o b ) : .* ?) : ( \d + ) (?: : ( \d + ) ) ? \) ? \s * $ / i;
5151const geckoEval = / ( \S + ) l i n e ( \d + ) (?: > e v a l l i n e \d + ) * > e v a l / i;
5252const chromeEval = / \( ( \S * ) (?: : ( \d + ) ) (?: : ( \d + ) ) \) / ;
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import {
1515 FIREFOX_43_EVAL ,
1616 FIREFOX_44_NS_EXCEPTION ,
1717 FIREFOX_50_RESOURCE_URL ,
18+ FIREFOX_FILE_IDENTIFIER ,
1819 IE_10 ,
1920 IE_11 ,
2021 IE_11_EVAL ,
@@ -869,6 +870,19 @@ describe('Tracekit - Original Tests', () => {
869870 } ) ;
870871 } ) ;
871872
873+ it ( 'should parse Firefox errors with `file` inside an identifier' , ( ) => {
874+ const stackFrames = computeStackTrace ( FIREFOX_FILE_IDENTIFIER ) ;
875+ expect ( stackFrames ) . toBeTruthy ( ) ;
876+ expect ( stackFrames . stack . length ) . toBe ( 3 ) ;
877+ expect ( stackFrames . stack [ 2 ] ) . toEqual ( {
878+ args : [ ] ,
879+ column : 1018410 ,
880+ func : 'handleProfileResult' ,
881+ line : 146 ,
882+ url : 'https://www.random_website.com/main.4a4119c3cdfd10266d84.js' ,
883+ } ) ;
884+ } ) ;
885+
872886 it ( 'should parse React Native errors on Android' , ( ) => {
873887 const stackFrames = computeStackTrace ( ANDROID_REACT_NATIVE ) ;
874888 expect ( stackFrames ) . toBeTruthy ( ) ;
Original file line number Diff line number Diff line change @@ -306,6 +306,18 @@ export const FIREFOX_50_RESOURCE_URL = {
306306 name : 'TypeError' ,
307307} ;
308308
309+ export const FIREFOX_FILE_IDENTIFIER = {
310+ stack :
311+ 'us@https://www.random_website.com/vendor.d1cae9cfc9917df88de7.js:1:296021\n' +
312+ 'detectChanges@https://www.random_website.com/vendor.d1cae9cfc9917df88de7.js:1:333807\n' +
313+ 'handleProfileResult@https://www.random_website.com/main.4a4119c3cdfd10266d84.js:146:1018410\n' ,
314+ fileName : 'resource://path/data/content/bundle.js' ,
315+ lineNumber : 5529 ,
316+ columnNumber : 16 ,
317+ message : 'this.props.raw[this.state.dataSource].rows is undefined' ,
318+ name : 'TypeError' ,
319+ } ;
320+
309321export const SAFARI_6 = {
310322 name : 'foo' ,
311323 message : "'null' is not an object (evaluating 'x.undef')" ,
You can’t perform that action at this time.
0 commit comments