-
Notifications
You must be signed in to change notification settings - Fork 244
Closed
Labels
confirmedissue reported has been reproducedissue reported has been reproduced
Description
Build environment: macOS
Moddable SDK version:
~/.jsvu/bin/xs -v
XS 16.8.1, slot 32 bytes, ID 4 bytes
Description
clearTimeout
crashes:
- on
undefined
- when called on the timeout id from that timeout callback
In this case notclearTimeout()
crashes, but internal handler -- see example 3
Case 2 is not catchable and crashes the process
Steps to Reproduce
~/.jsvu/bin/xs -e 'clearTimeout(undefined)'
~/.jsvu/bin/xs -e 'x=setTimeout(()=>clearTimeout(x), 100)'
~/.jsvu/bin/xs -e 'x=setTimeout(()=>{clearTimeout(x);print("cleared")}, 100)'
Expected behavior
It should do nothing if there is no timeout to remove
https://www.w3.org/TR/2011/WD-html5-20110525/timers.html#dom-windowtimers-cleartimeout
If handle does not identify an entry in the list of active timeouts of the WindowTimers object on which the method was invoked, the method does nothing.
Metadata
Metadata
Assignees
Labels
confirmedissue reported has been reproducedissue reported has been reproduced