This repository was archived by the owner on Feb 26, 2024. It is now read-only.
File tree 2 files changed +13
-2
lines changed
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,9 @@ export function patchEventTarget(
94
94
95
95
// global shared zoneAwareCallback to handle all event callback with capture = false
96
96
const globalZoneAwareCallback = function ( event : Event ) {
97
+ // https://github.com/angular/zone.js/issues/911, in IE, sometimes
98
+ // event will be undefined, so we need to use window.event
99
+ event = event || _global . event ;
97
100
if ( ! event ) {
98
101
return ;
99
102
}
@@ -123,6 +126,9 @@ export function patchEventTarget(
123
126
124
127
// global shared zoneAwareCallback to handle all event callback with capture = true
125
128
const globalZoneAwareCaptureCallback = function ( event : Event ) {
129
+ // https://github.com/angular/zone.js/issues/911, in IE, sometimes
130
+ // event will be undefined, so we need to use window.event
131
+ event = event || _global . event ;
126
132
if ( ! event ) {
127
133
return ;
128
134
}
Original file line number Diff line number Diff line change @@ -87,15 +87,20 @@ export const isMix: boolean = typeof _global.process !== 'undefined' &&
87
87
{ } . toString . call ( _global . process ) === '[object process]' && ! isWebWorker &&
88
88
! ! ( typeof window !== 'undefined' && ( window as any ) [ 'HTMLElement' ] ) ;
89
89
90
- const ON_PROPERTY_HANDLER_SYMBOL = zoneSymbol ( 'onPropertyHandler' ) ;
91
90
const zoneSymbolEventNames : { [ eventName : string ] : string } = { } ;
92
91
93
92
const wrapFn = function ( event : Event ) {
93
+ // https://github.com/angular/zone.js/issues/911, in IE, sometimes
94
+ // event will be undefined, so we need to use window.event
95
+ event = event || _global . event ;
96
+ if ( ! event ) {
97
+ return ;
98
+ }
94
99
let eventNameSymbol = zoneSymbolEventNames [ event . type ] ;
95
100
if ( ! eventNameSymbol ) {
96
101
eventNameSymbol = zoneSymbolEventNames [ event . type ] = zoneSymbol ( 'ON_PROPERTY' + event . type ) ;
97
102
}
98
- const target = this || event && event . target || _global ;
103
+ const target = this || event . target || _global ;
99
104
const listener = target [ eventNameSymbol ] ;
100
105
let result = listener && listener . apply ( this , arguments ) ;
101
106
You can’t perform that action at this time.
0 commit comments