@@ -123,6 +123,17 @@ describe('TraceKit', function () {
123
123
assert . deepEqual ( stackFrames . stack [ 2 ] , { url : 'http://localhost:8080/file.js' , func : 'I.e.fn.(anonymous function) [as index]' , args : [ ] , line : 10 , column : 3651 } ) ;
124
124
} ) ;
125
125
126
+ it ( 'should parse nested eval() from Chrome' , function ( ) {
127
+ var stackFrames = TraceKit . computeStackTrace ( CapturedExceptions . CHROME_48_EVAL ) ;
128
+ assert . ok ( stackFrames ) ;
129
+ assert . deepEqual ( stackFrames . stack . length , 5 ) ;
130
+ assert . deepEqual ( stackFrames . stack [ 0 ] , { url : 'http://localhost:8080/file.js' , func : 'baz' , args : [ ] , line : 21 , column : 17 } ) ;
131
+ assert . deepEqual ( stackFrames . stack [ 1 ] , { url : 'http://localhost:8080/file.js' , func : 'foo' , args : [ ] , line : 21 , column : 17 } ) ;
132
+ assert . deepEqual ( stackFrames . stack [ 2 ] , { url : 'http://localhost:8080/file.js' , func : 'eval' , args : [ ] , line : 21 , column : 17 } ) ;
133
+ assert . deepEqual ( stackFrames . stack [ 3 ] , { url : 'http://localhost:8080/file.js' , func : 'Object.speak' , args : [ ] , line : 21 , column : 17 } ) ;
134
+ assert . deepEqual ( stackFrames . stack [ 4 ] , { url : 'http://localhost:8080/file.js' , func : '?' , args : [ ] , line : 31 , column : 13 } ) ;
135
+ } ) ;
136
+
126
137
it ( 'should parse Chrome error with blob URLs' , function ( ) {
127
138
var stackFrames = TraceKit . computeStackTrace ( CapturedExceptions . CHROME_48_BLOB ) ;
128
139
assert . ok ( stackFrames ) ;
@@ -216,6 +227,18 @@ describe('TraceKit', function () {
216
227
assert . deepEqual ( stackFrames . stack . length , 3 ) ;
217
228
assert . deepEqual ( stackFrames . stack [ 0 ] , { url : 'resource://path/data/content/bundle.js' , func : 'render' , args : [ ] , line : 5529 , column : 16 } ) ;
218
229
} ) ;
230
+
231
+ it ( 'should parse Firefox errors with eval URLs' , function ( ) {
232
+ var stackFrames = TraceKit . computeStackTrace ( CapturedExceptions . FIREFOX_43_EVAL ) ;
233
+ assert . ok ( stackFrames ) ;
234
+ assert . deepEqual ( stackFrames . stack . length , 5 ) ;
235
+ assert . deepEqual ( stackFrames . stack [ 0 ] , { url : 'http://localhost:8080/file.js' , func : 'baz' , args :[ ] , line : 26 , column : null } ) ;
236
+ assert . deepEqual ( stackFrames . stack [ 1 ] , { url : 'http://localhost:8080/file.js' , func : 'foo' , args :[ ] , line : 26 , column : null } ) ;
237
+ assert . deepEqual ( stackFrames . stack [ 2 ] , { url : 'http://localhost:8080/file.js' , func : '?' , args :[ ] , line : 26 , column : null } ) ;
238
+ assert . deepEqual ( stackFrames . stack [ 3 ] , { url : 'http://localhost:8080/file.js' , func : 'speak' , args :[ ] , line : 26 , column : 17 } ) ;
239
+ assert . deepEqual ( stackFrames . stack [ 4 ] , { url : 'http://localhost:8080/file.js' , func : '?' , args :[ ] , line : 33 , column : 9 } ) ;
240
+ } ) ;
241
+
219
242
it ( 'should parse React Native errors on Android' , function ( ) {
220
243
var stackFrames = TraceKit . computeStackTrace ( CapturedExceptions . ANDROID_REACT_NATIVE ) ;
221
244
assert . ok ( stackFrames ) ;
0 commit comments