mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Merge branch 'master' into return-missing-css-errors
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user