W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2009

Re: [webidl] DOMString

From: Anne van Kesteren <annevk@opera.com>
Date: Tue, 21 Apr 2009 13:29:24 +0200
To: "Oliver Hunt" <oliver@apple.com>, "WebApps WG" <public-webapps@w3.org>
Message-ID: <op.usqh7av364w2qv@annevk-t60.oslo.opera.com>
On Tue, 21 Apr 2009 10:55:09 +0200, Oliver Hunt <oliver@apple.com> wrote:
> On Apr 21, 2009, at 1:38 AM, Anne van Kesteren wrote:
>> obj  = { toString:function() { throw("haha") } }
>> obj2 = { toString:function() { return 1 } }
>> obj3 = { toString:function() { return obj } }
>
> The [[ToString]] algorithm is defined in ECMAScript (Section 9.8, [1]),  
> the specified behaviour would result in [[ToString]] on obj2 producing  
> the string "1";  [[ToString]] on obj3 will result in a TypeError, as  
> [[DefaultValue]] will produce a non-primitive type (Section 9.1, [1])
>
> I would assume that the exception will be propagated to the runtime, but  
> it should be stated.
>
> [1] ECMA262-5 RC  
> http://www.ecma-international.org/publications/files/drafts/tc39-2009-025.pdf

Ok, that makes sense. This should also be clarified everywhere ToBoolean,  
ToNumber, ToUint16, and ToInt32 are invoked. (Plus anything I've missed  
:-))


-- 
Anne van Kesteren
http://annevankesteren.nl/
Received on Tuesday, 21 April 2009 11:30:12 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:31 GMT