@@ -364,26 +364,28 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
364
364
// ex.stacktrace = n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'
365
365
366
366
/**
367
- * Computes stack trace information from the stack property.
368
- * Chrome and Gecko use this property.
369
- * @param {Error } ex
370
- * @return {?Object.<string, *> } Stack trace information.
371
- */
367
+ * Computes stack trace information from the stack property.
368
+ * Chrome and Gecko use this property.
369
+ * @param {Error } ex
370
+ * @return {?Object.<string, *> } Stack trace information.
371
+ */
372
372
function computeStackTraceFromStackProp ( ex ) {
373
373
if ( typeof ex . stack === 'undefined' || ! ex . stack ) return ;
374
374
375
- var chrome = / ^ \s * a t ( .* ?) ? \( ( (?: f i l e | h t t p s ? | b l o b | c h r o m e - e x t e n s i o n | n a t i v e | e v a l | w e b p a c k | < a n o n y m o u s > | [ a - z ] : | \/ ) .* ?) (?: : ( \d + ) ) ? (?: : ( \d + ) ) ? \) ? \s * $ / i,
376
- 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 | \[ n a t i v e ) .* ?| [ ^ @ ] * b u n d l e ) (?: : ( \d + ) ) ? (?: : ( \d + ) ) ? \s * $ / i,
377
- 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 (?: - w e b ) | h t t p s ? | w e b p a c k | b l o b ) : .* ?) : ( \d + ) (?: : ( \d + ) ) ? \) ? \s * $ / i,
378
- // Used to additionally parse URL/line/column from eval frames
379
- geckoEval = / ( \S + ) l i n e ( \d + ) (?: > e v a l l i n e \d + ) * > e v a l / i,
380
- chromeEval = / \( ( \S * ) (?: : ( \d + ) ) (?: : ( \d + ) ) \) / ,
381
- lines = ex . stack . split ( '\n' ) ,
382
- stack = [ ] ,
383
- submatch ,
384
- parts ,
385
- element ,
386
- reference = / ^ ( .* ) i s u n d e f i n e d $ / . exec ( ex . message ) ;
375
+ var chrome = / ^ \s * a t ( .* ?) ? \( ( (?: f i l e | h t t p s ? | b l o b | c h r o m e - e x t e n s i o n | n a t i v e | e v a l | w e b p a c k | < a n o n y m o u s > | [ a - z ] : | \/ ) .* ?) (?: : ( \d + ) ) ? (?: : ( \d + ) ) ? \) ? \s * $ / i;
376
+ var 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 (?: - w e b ) | h t t p s ? | w e b p a c k | b l o b ) : .* ?) : ( \d + ) (?: : ( \d + ) ) ? \) ? \s * $ / i;
377
+ // NOTE: blob urls are now supposed to always have an origin, therefore it's format
378
+ // which is `blob:http://url/path/with-some-uuid`, is matched by `blob.*?:\/` as well
379
+ var 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 ) .* ?: \/ .* ?| \[ n a t i v e c o d e \] | [ ^ @ ] * b u n d l e ) (?: : ( \d + ) ) ? (?: : ( \d + ) ) ? \s * $ / i;
380
+ // Used to additionally parse URL/line/column from eval frames
381
+ var geckoEval = / ( \S + ) l i n e ( \d + ) (?: > e v a l l i n e \d + ) * > e v a l / i;
382
+ var chromeEval = / \( ( \S * ) (?: : ( \d + ) ) (?: : ( \d + ) ) \) / ;
383
+ var lines = ex . stack . split ( '\n' ) ;
384
+ var stack = [ ] ;
385
+ var submatch ;
386
+ var parts ;
387
+ var element ;
388
+ var reference = / ^ ( .* ) i s u n d e f i n e d $ / . exec ( ex . message ) ;
387
389
388
390
for ( var i = 0 , j = lines . length ; i < j ; ++ i ) {
389
391
if ( ( parts = chrome . exec ( lines [ i ] ) ) ) {
0 commit comments