| 166 | var funcArgs = Array.prototype.slice.call(arguments, 3); |
| 167 | |
| 168 | function callCallback() { |
| 169 | // We immediately remove the callback from event listeners so that |
| 170 | // nested `invokeGuardedCallback` calls do not clash. Otherwise, a |
| 171 | // nested call would trigger the fake event handlers of any call higher |
| 172 | // in the stack. |
| 173 | fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the |
| 174 | // window.event assignment in both IE <= 10 as they throw an error |
| 175 | // "Member not found" in strict mode, and in Firefox which does not |
| 176 | // support window.event. |
| 177 | |
| 178 | if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) { |
| 179 | window.event = windowEvent; |
| 180 | } |
| 181 | |
| 182 | func.apply(context, funcArgs); |
| 183 | didError = false; |
| 184 | } // Create a global error event handler. We use this to capture the value |
| 185 | // that was thrown. It's possible that this error handler will fire more |
| 186 | // than once; for example, if non-React code also calls `dispatchEvent` |
| 187 | // and a handler for that event throws. We should be resilient to most of |