File tree 3 files changed +27
-1
lines changed 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
46
46
// gecko regex: `(?:bundle|\d+\.js)`: `bundle` is for react native, `\d+\.js` also but specifically for ram bundles because it
47
47
// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js
48
48
// 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;
50
50
const 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;
51
51
const geckoEval = / ( \S + ) l i n e ( \d + ) (?: > e v a l l i n e \d + ) * > e v a l / i;
52
52
const chromeEval = / \( ( \S * ) (?: : ( \d + ) ) (?: : ( \d + ) ) \) / ;
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import {
15
15
FIREFOX_43_EVAL ,
16
16
FIREFOX_44_NS_EXCEPTION ,
17
17
FIREFOX_50_RESOURCE_URL ,
18
+ FIREFOX_FILE_IDENTIFIER ,
18
19
IE_10 ,
19
20
IE_11 ,
20
21
IE_11_EVAL ,
@@ -869,6 +870,19 @@ describe('Tracekit - Original Tests', () => {
869
870
} ) ;
870
871
} ) ;
871
872
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
+
872
886
it ( 'should parse React Native errors on Android' , ( ) => {
873
887
const stackFrames = computeStackTrace ( ANDROID_REACT_NATIVE ) ;
874
888
expect ( stackFrames ) . toBeTruthy ( ) ;
Original file line number Diff line number Diff line change @@ -306,6 +306,18 @@ export const FIREFOX_50_RESOURCE_URL = {
306
306
name : 'TypeError' ,
307
307
} ;
308
308
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
+
309
321
export const SAFARI_6 = {
310
322
name : 'foo' ,
311
323
message : "'null' is not an object (evaluating 'x.undef')" ,
You can’t perform that action at this time.
0 commit comments