- From: Domenic Denicola <domenic@domenicdenicola.com>
- Date: Wed, 20 Mar 2013 17:41:03 +0000
- To: Boris Zbarsky <bzbarsky@MIT.EDU>
- CC: Anne van Kesteren <annevk@annevk.nl>, Marcos Caceres <w3c@marcosc.com>, Yehuda Katz <wycats@gmail.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>
From: Boris Zbarsky [bzbarsky@MIT.EDU] > On 3/20/13 12:46 PM, Domenic Denicola wrote: >> Or is the idea that properties specified as non-negative integers should have setters that throw when you set them to negative integers or to floating point numbers? > A property specified as "unsigned long" in IDL takes its input, converts it to a JS Number, then applies ToUint32 from the ES spec, then works with the result. That was what I was curious about; thanks! So it's this pattern WebIDL is meant to encourage. Essentially it is a declarative way of doing the argument-type coercion you find in the ES spec, e.g. step 5 of http://es5.github.com/#x15.3.4.3 In that case I'd imagine the number types you'd want are Number, Integer, Int32, Uint32, and Uint16. (Although Uint16 is only used for char codes in ES5, so maybe that can be omitted.) I think this matches what you were saying up-thread.
Received on Wednesday, 20 March 2013 17:41:39 UTC