File tree Expand file tree Collapse file tree 1 file changed +4
-17
lines changed Expand file tree Collapse file tree 1 file changed +4
-17
lines changed Original file line number Diff line number Diff line change 35
35
try {
36
36
fn ( ) ;
37
37
} catch ( e ) {
38
- // In IE6, manually throwing errors doesn't trigger window.onerror.
39
- // Instead, we'll pass an actual error to the `done` callback.
40
- if ( IS_IE6 ) {
41
- if ( Object . isFunction ( done ) ) {
42
- return done ( new Error ( e . message ) ) ;
43
- }
44
- }
45
-
46
- // In IE7, window.onerror will get triggered, but with a generic
47
- // error message. Instead we need to throw an actual Error object
48
- // because it does not grok this whole custom error thing.
49
- if ( IS_IE7 ) {
50
- throw new Error ( e . message ) ;
51
- }
52
-
53
- // In other browsers, we can just re-throw it and be fine.
54
- throw e ;
38
+ // Instead of relying on window.onerror to detect an error was
39
+ // thrown (which is problematic in IE6-7), we invoke the callback
40
+ // with an error the way Mocha expects.
41
+ return done ( e ) ;
55
42
}
56
43
} ;
57
44
return setTimeout ( handler , duration ) ;
You can’t perform that action at this time.
0 commit comments