W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2012

Re: Should Exceptions be Errors in the ECMAScript bindings?

From: Cameron McCormack <cam@mcc.id.au>
Date: Fri, 22 Jun 2012 16:43:14 +1000
Message-ID: <4FE41402.8020504@mcc.id.au>
To: Allen Wirfs-Brock <allen@wirfs-brock.com>
CC: Travis Leithead <Travis.Leithead@microsoft.com>, Erik Arvidsson <arv@chromium.org>, "public-script-coord@w3.org" <public-script-coord@w3.org>
Allen Wirfs-Brock:
> In ECMAScript, prototype chain inheritance does not establish a deep semantic "is-a" relationship. In particular,
>       var foo=Object.create(Error.prototype)
> does not give foo any special Error object internal semantic state or behavior (eg, implementation specific stack trace semantics).

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 
Received on Friday, 22 June 2012 06:43:55 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:06 UTC