This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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 Comment: setTimeout behavior seems to be undefined if ToString throws Posted from: 71.184.125.56 User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0a1) Gecko/20110628 Firefox/7.0a1
In particular, just propagating the exception out from that point would leave the timeout list in an inconsistent state (with an entry that can't actually be processed).
More data here: Gecko tries to do the ToString conversion _before_ adding anything to the timeout list, and if ToString() throws will just throw from setTimeout. But that's not compatible with the spec's requirements on timer ordering (e.g. a timer added from inside ToString() should per spec fire after the one that was being added when ToString() was called, while in Gecko it will fire before).
mass-move component to LC1
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document: http://dev.w3.org/html5/decision-policy/decision-policy.html Status: Accepted Change Description: see diff below Rationale: Recent changes mean that this is now defined in such a way as to be what you describe. I've added a note and example to make it clearer.
Checked in as WHATWG revision r6492. Check-in comment: Explain ordering of setTimeout() calls better http://html5.org/tools/web-apps-tracker?from=6491&to=6492