@ -18,7 +18,7 @@ Zone.__load_patch('cordova', (global: any, Zone: ZoneType, api: _ZonePrivate) =>
|
||||
if (args.length > 1 && typeof args[1] === FUNCTION) {
|
||||
args[1] = Zone.current.wrap(args[1], ERROR_SOURCE);
|
||||
}
|
||||
return nativeExec !.apply(self, args);
|
||||
return nativeExec!.apply(self, args);
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -31,7 +31,9 @@ Zone.__load_patch('cordova.FileReader', (global: any, Zone: ZoneType) => {
|
||||
const eventNameSymbol = Zone.__symbol__('ON_PROPERTY' + prop);
|
||||
Object.defineProperty(FileReader.prototype, eventNameSymbol, {
|
||||
configurable: true,
|
||||
get: function() { return this._realReader && this._realReader[eventNameSymbol]; }
|
||||
get: function() {
|
||||
return this._realReader && this._realReader[eventNameSymbol];
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -70,8 +70,10 @@ Zone.__load_patch('jsonp', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
|
||||
|
||||
api.patchMethod(
|
||||
options.jsonp, options.sendFuncName, (delegate: Function) => (self: any, args: any[]) => {
|
||||
global[api.symbol('jsonpTask')] = Zone.current.scheduleMacroTask(
|
||||
'jsonp', noop, {}, (task: Task) => { return delegate.apply(self, args); }, noop);
|
||||
global[api.symbol('jsonpTask')] =
|
||||
Zone.current.scheduleMacroTask('jsonp', noop, {}, (task: Task) => {
|
||||
return delegate.apply(self, args);
|
||||
}, noop);
|
||||
});
|
||||
};
|
||||
});
|
||||
|
@ -12,7 +12,9 @@ Zone.__load_patch('socketio', (global: any, Zone: ZoneType, api: _ZonePrivate) =
|
||||
useG: false,
|
||||
chkDup: false,
|
||||
rt: true,
|
||||
diff: (task: any, delegate: any) => { return task.callback === delegate; }
|
||||
diff: (task: any, delegate: any) => {
|
||||
return task.callback === delegate;
|
||||
}
|
||||
});
|
||||
// also patch io.Socket.prototype.on/off/removeListener/removeAllListeners
|
||||
io.Socket.prototype.on = io.Socket.prototype.addEventListener;
|
||||
|
Reference in New Issue
Block a user