@@ -45,13 +45,21 @@ Zone.__load_patch('blocking', (global: any, Zone: ZoneType, api: _ZonePrivate) =
45
45
Zone . __load_patch ( 'EventTarget' , ( global : any , Zone : ZoneType , api : _ZonePrivate ) => {
46
46
eventTargetPatch ( global , api ) ;
47
47
// patch XMLHttpRequestEventTarget's addEventListener/removeEventListener
48
- const XMLHttpRequestEventTarget = ( global as any ) [ 'XMLHttpRequestEventTarget' ] ;
48
+ const XMLHttpRequestEventTarget = global [ 'XMLHttpRequestEventTarget' ] ;
49
49
if ( XMLHttpRequestEventTarget && XMLHttpRequestEventTarget . prototype ) {
50
50
api . patchEventTarget ( global , [ XMLHttpRequestEventTarget . prototype ] ) ;
51
51
}
52
52
patchClass ( 'MutationObserver' ) ;
53
53
patchClass ( 'WebKitMutationObserver' ) ;
54
- patchClass ( 'FileReader' ) ;
54
+ // FileReader's onProperty should be patched
55
+ // and if FileReader not implements EventTarget
56
+ // we should patch FileReader.prototype.addEventListener
57
+ const FileReader = global [ 'FileReader' ] ;
58
+ if ( FileReader && FileReader . prototype ) {
59
+ patchOnProperties (
60
+ FileReader . prototype , [ 'abort' , 'error' , 'load' , 'loadstart' , 'loadend' , 'progress' ] ) ;
61
+ api . patchEventTarget ( global , [ FileReader . prototype ] ) ;
62
+ }
55
63
} ) ;
56
64
57
65
Zone . __load_patch ( 'on_property' , ( global : any , Zone : ZoneType , api : _ZonePrivate ) => {
0 commit comments