@@ -38,7 +38,6 @@ interface ComputeStackTrace {
3838 * @param {(string|number)= } depth
3939 */
4040 ( ex : Error , depth ?: string | number ) : StackTrace ;
41- _computeStackTraceFromStackProp ( ex : any ) : StackTrace ;
4241}
4342
4443/**
@@ -479,7 +478,7 @@ TraceKit._computeStackTrace = (function _computeStackTraceWrapper() {
479478 // gecko regex: `(?:bundle|\d+\.js)`: `bundle` is for react native, `\d+\.js` also but specifically for ram bundles because it
480479 // generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js
481480 // We need this specific case for now because we want no other regex to match.
482- 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 ) .* ?: \/ .* ?| \[ n a t i v e c o d e \] | [ ^ @ ] * (?: b u n d l e | \d + \. j s ) ) (?: : ( \d + ) ) ? (?: : ( \d + ) ) ? \s * $ / i,
481+ 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 ) .* ?: \/ .* ?| \[ n a t i v e c o d e \] | [ ^ @ ] * (?: b u n d l e | \d + \. j s ) ) (?: : ( \d + ) ) ? (?: : ( \d + ) ) ? \s * $ / i,
483482 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,
484483 // Used to additionally parse URL/line/column from eval frames
485484 isEval ,
@@ -494,6 +493,7 @@ TraceKit._computeStackTrace = (function _computeStackTraceWrapper() {
494493
495494 for ( var i = 0 , j = lines . length ; i < j ; ++ i ) {
496495 if ( ( parts = chrome . exec ( lines [ i ] ) ) ) {
496+ var isNative = parts [ 2 ] && parts [ 2 ] . indexOf ( 'native' ) === 0 ; // start of line
497497 isEval = parts [ 2 ] && parts [ 2 ] . indexOf ( 'eval' ) === 0 ; // start of line
498498 if ( isEval && ( submatch = chromeEval . exec ( parts [ 2 ] ) ) ) {
499499 // throw out eval line/column and use top-most line/column number
@@ -504,7 +504,7 @@ TraceKit._computeStackTrace = (function _computeStackTraceWrapper() {
504504 element = {
505505 url : parts [ 2 ] ,
506506 func : parts [ 1 ] || UNKNOWN_FUNCTION ,
507- args : [ ] ,
507+ args : isNative ? [ parts [ 2 ] ] : [ ] ,
508508 line : parts [ 3 ] ? + parts [ 3 ] : null ,
509509 column : parts [ 4 ] ? + parts [ 4 ] : null ,
510510 } ;
@@ -520,6 +520,7 @@ TraceKit._computeStackTrace = (function _computeStackTraceWrapper() {
520520 isEval = parts [ 3 ] && parts [ 3 ] . indexOf ( ' > eval' ) > - 1 ;
521521 if ( isEval && ( submatch = geckoEval . exec ( parts [ 3 ] ) ) ) {
522522 // throw out eval line/column and use top-most line number
523+ parts [ 1 ] = parts [ 1 ] || `eval` ;
523524 parts [ 3 ] = submatch [ 1 ] ;
524525 parts [ 4 ] = submatch [ 2 ] ;
525526 parts [ 5 ] = '' ; // no column when eval
0 commit comments