Bug 973849. Allow clearInterval/clearTimeout calls with no arguments; just treat them as no-ops. r=smaug

This commit is contained in:
Boris Zbarsky 2014-02-23 00:01:26 -05:00
Родитель b458b3ad8d
Коммит 7035c5e17b
3 изменённых файлов: 17 добавлений и 2 удалений

Просмотреть файл

@ -9,6 +9,7 @@ support-files =
[test_Image_constructor.html]
[test_appname_override.html]
[test_bug913761.html]
[test_clearTimeoutIntervalNoArg.html]
[test_constructor-assignment.html]
[test_constructor.html]
[test_document.all_unqualified.html]

Просмотреть файл

@ -0,0 +1,14 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Test for clearTimeout/clearInterval with no arguments not throwing</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(function() {
clearTimeout();
}, "clearTimeout with no args should not throw ");
test(function() {
clearInterval();
}, "clearInterval with no args should not throw ");
</script>

Просмотреть файл

@ -88,10 +88,10 @@ Window implements WindowEventHandlers;
interface WindowTimers {
[Throws] long setTimeout(Function handler, optional long timeout = 0, any... arguments);
[Throws] long setTimeout(DOMString handler, optional long timeout = 0, any... unused);
[Throws] void clearTimeout(long handle);
[Throws] void clearTimeout(optional long handle = 0);
[Throws] long setInterval(Function handler, optional long timeout, any... arguments);
[Throws] long setInterval(DOMString handler, optional long timeout, any... unused);
[Throws] void clearInterval(long handle);
[Throws] void clearInterval(optional long handle = 0);
};
Window implements WindowTimers;