- From: Allen Wirfs-Brock <allen@wirfs-brock.com>
- Date: Fri, 22 Jun 2012 08:51:16 -0700
- To: Cameron McCormack <cam@mcc.id.au>
- Cc: Travis Leithead <Travis.Leithead@microsoft.com>, Erik Arvidsson <arv@chromium.org>, "public-script-coord@w3.org" <public-script-coord@w3.org>
On Jun 21, 2012, at 11:51 PM, Cameron McCormack wrote: > Cameron McCormack: >> What would be required to make exception objects be true Error objects? >> Is it sufficient to have Web IDL just say that they have [[Class]] >> "Error"? Do Error objects have any standardised behaviour that you >> wouldn't get from just using prototype inheritance as Web IDL currently >> does? > > There is also the fact that ({}).toString.call(aDOMException) needs to return "[object DOMException]". > ES6 is eliminating [[Class]] in order to make it clear that it is not intended as a poor man's extensible nominal type tag. In ES6, {}.toString currently does support open ended parameterization. If you want to modify toString behavior for some family of object, you need to define your own toString methods. Given this direction, it probably isn't a good idea for WebIDL to be trying to standardize [[Class]] values and their usage as type tags. Allen
Received on Friday, 22 June 2012 15:51:53 UTC