Re: Clarification on exceptions

I think that the spec does implicitly specify a behavior, since Web
IDL specifies the conversion between an ECMAScript value and an IDL
type.

For example, for the PositionCallback argument, Web IDL states that if
an argument is passed that does not implement the interface, a
TypeError should be thrown -
http://dev.w3.org/2006/webapi/WebIDL/#es-interface.

A complication is in the handling of a null value for the
PositionCallback argument. I think that a null ECMAScript value is
successfully converted to an IDL interface of value null -
http://dev.w3.org/2006/webapi/WebIDL/#idl-interface. The Geolocation
spec states that we should then abort the operation on receipt of a
null value.

This does not match the behavior of the current implementations, which
throw an exception if a null value is passed. We should probably
consider updating the spec to reflect this behavior.

Steve

-- 
Google UK Limited
Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W 9TQ
Registered in England Number: 3977902

Received on Saturday, 12 February 2011 02:39:56 UTC