@@ -116,6 +116,20 @@ describe('ErrorStackParser', function() {
116
116
expect ( stackFrames [ 4 ] ) . toMatchStackFrame ( [ undefined , undefined , 'http://localhost:8080/file.js' , 31 , 13 ] ) ;
117
117
} ) ;
118
118
119
+ it ( 'should parse and set eval origin for eval() from V8' , function ( ) {
120
+ var stackFrames = unit . parse ( CapturedExceptions . CHROME_58_EVAL ) ;
121
+ expect ( stackFrames ) . toBeTruthy ( ) ;
122
+ expect ( stackFrames . length ) . toBe ( 6 ) ;
123
+ expect ( stackFrames [ 0 ] ) . toMatchStackFrame ( [ 'willThrow' , undefined , 'index.js' , 11 , undefined ] ) ;
124
+ expect ( stackFrames [ 0 ] . getEvalOrigin ( ) ) . toMatchStackFrame ( [ 'eval' , undefined , '<anonymous>' , 3 , 3 ] ) ;
125
+ expect ( stackFrames [ 1 ] ) . toMatchStackFrame ( [ 'eval' , undefined , 'index.js' , 11 , undefined ] ) ;
126
+ expect ( stackFrames [ 1 ] . getEvalOrigin ( ) ) . toMatchStackFrame ( [ 'eval' , undefined , '<anonymous>' , 6 , 1 ] ) ;
127
+ expect ( stackFrames [ 2 ] ) . toMatchStackFrame ( [ 'h' , undefined , 'index.js' , 11 , undefined ] ) ;
128
+ expect ( stackFrames [ 3 ] ) . toMatchStackFrame ( [ 'g' , undefined , 'index.js' , 6 , undefined ] ) ;
129
+ expect ( stackFrames [ 4 ] ) . toMatchStackFrame ( [ 'f' , undefined , 'index.js' , 2 , undefined ] ) ;
130
+ expect ( stackFrames [ 5 ] ) . toMatchStackFrame ( [ undefined , undefined , 'index.js' , 23 , undefined ] ) ;
131
+ } ) ;
132
+
119
133
it ( 'should parse IE 10 Error stacks' , function ( ) {
120
134
var stackFrames = unit . parse ( CapturedExceptions . IE_10 ) ;
121
135
expect ( stackFrames ) . toBeTruthy ( ) ;
@@ -210,7 +224,8 @@ describe('ErrorStackParser', function() {
210
224
} ) ;
211
225
212
226
it ( 'should handle webpack eval stacks' , function ( ) {
213
- var stackframes = unit . parse ( { stack : 'ReferenceError: chilxdren is not defined\n ' +
227
+ var stackframes = unit . parse ( {
228
+ stack : 'ReferenceError: chilxdren is not defined\n ' +
214
229
'at Layout (eval at proxyClass (webpack:///../react-hot-loader/~/react-proxy/modules/createClassProxy.js?), <anonymous>:4:17)'
215
230
} ) ;
216
231
expect ( stackframes . length ) . toBe ( 1 ) ;
0 commit comments