fix(zone.js): clearTimeout/clearInterval should call on object global (#37858)

Close #37333

`clearTimeout` is patched by `zone.js`, and it finally calls the native delegate of `clearTimeout`,
the current implemention only call `clearNative(id)`, but it should call on object `global` like
`clearNative.call(global, id)`. Otherwise in some env, it will throw error
`clearTimeout called on an object that does not implement interface Window`

PR Close #37858
This commit is contained in:
JiaLiPassion
2020-07-01 06:11:14 +09:00
committed by Michael Prentice
parent 788532dc99
commit 9e7ce2c916
2 changed files with 22 additions and 1 deletions

View File

@ -55,7 +55,7 @@ export function patchTimer(window: any, setName: string, cancelName: string, nam
}
function clearTask(task: Task) {
return clearNative!((<TimerOptions>task.data).handleId);
return clearNative!.call(window, (<TimerOptions>task.data).handleId);
}
setNative =