Merge branch 'master' into return-missing-css-errors

This commit is contained in:
Svetoslav
2019-08-02 19:16:37 +03:00
committed by GitHub
3 changed files with 26 additions and 0 deletions

View File

@@ -16,6 +16,9 @@ function createHandlerAndGetId(): number {
}
export function setTimeout(callback: Function, milliseconds = 0, ...args): number {
// Cast to Number
milliseconds += 0;
const id = createHandlerAndGetId();
const invoke = () => callback(...args);
const zoneBound = zonedCallback(invoke);
@@ -48,6 +51,9 @@ export function clearTimeout(id: number): void {
}
export function setInterval(callback: Function, milliseconds = 0, ...args): number {
// Cast to Number
milliseconds += 0;
const id = createHandlerAndGetId();
const handler = timeoutHandler;
const invoke = () => callback(...args);

View File

@@ -48,6 +48,9 @@ class TimerTargetImpl extends NSObject {
}
function createTimerAndGetId(callback: Function, milliseconds: number, shouldRepeat: boolean): number {
// Cast to Number
milliseconds += 0;
timerId++;
let id = timerId;
let timerTarget = TimerTargetImpl.initWithCallback(callback, id, shouldRepeat);