Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/webappapis/timers/cleartimeout-clearinterval.any.html - WPT Dashboard Interop Dashboard
- /html/webappapis/timers/cleartimeout-clearinterval.any.worker.html - WPT Dashboard Interop Dashboard
async_test((t) => {
const handle = setTimeout(
t.step_func(() => {
assert_unreached("Timeout was not canceled");
}),
0
);
clearInterval(handle);
setTimeout(() => {
t.done();
}, 100);
}, "Clear timeout with clearInterval");
async_test((t) => {
const handle = setInterval(
t.step_func(() => {
assert_unreached("Interval was not canceled");
}),
0
);
clearTimeout(handle);
setTimeout(() => {
t.done();
}, 100);
}, "Clear interval with clearTimeout");