[Bug 16457] IDL exceptions as platform objects

https://www.w3.org/Bugs/Public/show_bug.cgi?id=16457

--- Comment #2 from Cameron McCormack <cam@mcc.id.au> 2012-03-21 23:12:24 UTC ---
Most (all?) behaviours of platform objects you should be able to implement
using Proxies.

Note that platform objects do not necessarily have to be ECMAScript host
objects, so you could very well use a native object to implement them,
especially since they don't need any special behaviour that you would need
Proxies for.

You will need to track some internal state for them though, to "know" that they
are platform objects.  This is because:

* Object.prototype.toString needs to return "[object DOMException]" say for the
DOMException IDL exception.  Object.prototype.toString is defined to look at
the object's class string, if it is a platform object.

* Platform objects cannot be passed to something expecting a dictionary type,
or a callback interface type.

* The accessor property get/set functions for exception fields inspect their
this object to ensure they are a platform object of the right type (and if not,
throw).

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Received on Wednesday, 21 March 2012 23:12:27 UTC