W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2009

Re: [webdatabase] Handling of the query arguments

From: João Eiras <joaoe@opera.com>
Date: Thu, 19 Nov 2009 23:50:33 +0100
To: "public-webapps@w3.org" <public-webapps@w3.org>
Message-ID: <op.u3ny2jz82q99of@id-c0981>

>> 2) We can define, in the Web IDL, how an object can be converted to a  
>> primitive type.
>> Specifically, in an ecmascript binding we can do the following (note:  
>> returns means to stop the steps):
>> - if object is null, return null
>> - if object has a member function called valueOf, invoke valueOf in the  
>> context of object
>>   - if the returned value is a primitive type, return the value,
>> - if object has a member function called toString, invoke toString in  
>> the context of object
>>   - if the returned value is a primitive type, return the value,
>> - return Object.prototype.toString.call(object), so we get "[object  
>> Class]"
>
> ECMAScript defines a ToPrimitive conversion (Section 9.1 of ECMA-262 5th  
> edition). I think the right thing to do would be for some spec to point  
> to those steps. Probably it has to be Web Database, because in many  
> cases where a Web IDL method takes an "any" type, it's not appropriate  
> to do ToPrimitive conversion.
>

Indeed !

-- 

João Eiras
Core Developer, Opera Software ASA, http://www.opera.com/
Received on Thursday, 19 November 2009 22:51:13 GMT

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