diff options
author | 迷渡 <justjavac@gmail.com> | 2019-06-18 01:42:20 +0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-06-17 10:42:20 -0700 |
commit | 9ad5b0653e3821915d7ab7438d5ed4fe373c569a (patch) | |
tree | e9853fea11dc1ee510e6db8c832b68108d4a2a49 /js/timers.ts | |
parent | a95319074240a869dce088fa580e46a067a8e7d1 (diff) |
clearTimeout should convert to number (#2539)
Diffstat (limited to 'js/timers.ts')
-rw-r--r-- | js/timers.ts | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/js/timers.ts b/js/timers.ts index ba9a653a8..0d0e1e69a 100644 --- a/js/timers.ts +++ b/js/timers.ts @@ -250,6 +250,7 @@ export function setInterval( /** Clears a previously set timer by id. AKA clearTimeout and clearInterval. */ export function clearTimer(id: number): void { + id = Number(id); const timer = idMap.get(id); if (timer === undefined) { // Timer doesn't exist any more or never existed. This is not an error. |