File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,8 @@ var create_callsite = function(location) {
5858} ;
5959
6060Error . prepareStackTrace = function ( error , structured_stack_trace ) {
61+ // console.log('Error.prepareStackTrace');
62+
6163 error . __cached_trace__ = structured_stack_trace . filter ( function ( f ) {
6264 return f . getFileName ( ) !== filename ;
6365 } ) ;
Original file line number Diff line number Diff line change @@ -26,6 +26,32 @@ describe('longjohn', function() {
2626 } , 1 ) ;
2727 } ) ;
2828
29+ it ( 'should work for issue #10' , function ( done ) {
30+ function a ( ) {
31+ b ( ) ;
32+ }
33+
34+ function b ( ) {
35+ assert . equal ( new Error ( 'this is uncaught!' ) . stack . split ( longjohn . empty_frame ) . length , 2 ) ;
36+ return done ( ) ;
37+ }
38+
39+ setTimeout ( a , 0 ) ;
40+ } ) ;
41+
42+ it ( 'should work for issue #10-2' , function ( done ) {
43+ function a ( ) {
44+ setTimeout ( b , 0 ) ;
45+ }
46+
47+ function b ( ) {
48+ assert . equal ( new Error ( 'this is uncaught!' ) . stack . split ( longjohn . empty_frame ) . length , 3 ) ;
49+ return done ( ) ;
50+ }
51+
52+ setTimeout ( a , 0 ) ;
53+ } ) ;
54+
2955 it ( 'should allow stack size limiting' , function ( done ) {
3056 longjohn . async_trace_limit = 2 ;
3157
You can’t perform that action at this time.
0 commit comments