| 3867 | var funcArgs = Array.prototype.slice.call(arguments, 3); |
| 3868 | |
| 3869 | function callCallback() { |
| 3870 | // We immediately remove the callback from event listeners so that |
| 3871 | // nested `invokeGuardedCallback` calls do not clash. Otherwise, a |
| 3872 | // nested call would trigger the fake event handlers of any call higher |
| 3873 | // in the stack. |
| 3874 | fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the |
| 3875 | // window.event assignment in both IE <= 10 as they throw an error |
| 3876 | // "Member not found" in strict mode, and in Firefox which does not |
| 3877 | // support window.event. |
| 3878 | |
| 3879 | if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) { |
| 3880 | window.event = windowEvent; |
| 3881 | } |
| 3882 | |
| 3883 | func.apply(context, funcArgs); |
| 3884 | didError = false; |
| 3885 | } // Create a global error event handler. We use this to capture the value |
| 3886 | // that was thrown. It's possible that this error handler will fire more |
| 3887 | // than once; for example, if non-React code also calls `dispatchEvent` |
| 3888 | // and a handler for that event throws. We should be resilient to most of |