This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 24778 - clearInterval/setInterval with no argument need to silently no-op, not throw
Summary: clearInterval/setInterval with no argument need to silently no-op, not throw
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-22 23:22 UTC by contributor
Modified: 2014-02-24 18:45 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2014-02-22 23:22:34 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html
Multipage: http://www.whatwg.org/C#timers
Complete: http://www.whatwg.org/c#timers
Referrer: http://www.whatwg.org/specs/web-apps/current-work/multipage/

Comment:
clearInterval/setInterval with no argument need to silently no-op, not throw

Posted from: 98.110.194.132 by bzbarsky@mit.edu
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:30.0) Gecko/20100101 Firefox/30.0
Comment 1 Boris Zbarsky 2014-02-22 23:23:57 UTC
See https://bugzilla.mozilla.org/show_bug.cgi?id=973849 and duplicates.

The fix I'm doing for Gecko is this:

-  void clearTimeout(long handle);
+  void clearTimeout(optional long handle = 0);
-  void clearInterval(long handle);
+  void clearInterval(optional long handle = 0);

Since 0 is never a valid handle value, this automatically makes the methods no-ops when called with no arguments.
Comment 2 Ian 'Hixie' Hickson 2014-02-24 18:45:08 UTC
done as suggested