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 16597 - Regarding item 4: "timeout" may be passed as a native array, e.g. setTimeout(do_simething, [10]), in which case it needs to be un-wrapped to an integer
Summary: Regarding item 4: "timeout" may be passed as a native array, e.g. setTimeout(...
Status: RESOLVED WORKSFORME
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: 2012-04-02 06:48 UTC by contributor
Modified: 2012-07-18 18:42 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2012-04-02 06:48:24 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/
Multipage: http://www.whatwg.org/C#dom-windowtimers-settimeout
Complete: http://www.whatwg.org/c#dom-windowtimers-settimeout

Comment:
Regarding item 4: "timeout" may be passed as a native array, e.g.
setTimeout(do_simething, [10]), in which case it needs to be un-wrapped to an
integer

Posted from: 82.192.88.2 by manish.tripathi.777@gmail.com
User agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0
Comment 1 Ms2ger 2012-05-14 17:17:33 UTC
Indeed. This is handled by WebIDL and ES5. ToUint32 calls ToNumber calls ToPrimitive [Number] which calls [10].toString(), which is "10", which is turned into 10 by ToNumber.