- From: Cameron McCormack <cam@mcc.id.au>
- Date: Wed, 17 Jun 2009 16:39:11 +1000
- To: WebApps WG <public-webapps@w3.org>
- Cc: Anne van Kesteren <annevk@opera.com>, Oliver Hunt <oliver@apple.com>
Anne van Kesteren: > If something takes a DOMString as value is it clearly defined what > happens if the toString algorithm throws or returns a non-DOMString? I > haven't been able to find descriptions for that in the Web IDL > specification. E.g. > > obj = { toString:function() { throw("haha") } } > obj2 = { toString:function() { return 1 } } > obj3 = { toString:function() { return obj } } Oliver Hunt: > 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. Added some text for this: http://dev.w3.org/2006/webapi/WebIDL/#es-handling-exceptions Let me know if you think it’s insufficient. Thanks, Cameron -- Cameron McCormack ≝ http://mcc.id.au/
Received on Wednesday, 17 June 2009 06:39:49 UTC