W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2012

use of SyntaxError DOMException

From: Cameron McCormack <cam@mcc.id.au>
Date: Fri, 27 Apr 2012 09:49:20 +1000
Message-ID: <4F99DF00.3080503@mcc.id.au>
To: "www-dom@w3.org" <www-dom@w3.org>
The DOM spec defines exception types for each of the DOMException codes. 
  One of them is "SyntaxError", which corresponds to the SYNTAX_ERR 
code.  But we also have the built-in SyntaxError exception, the one 
whose instances have [[Prototype]] == SyntaxError.prototype.  (It would 
be nice if we could merge these somehow, but I think that would be 
difficult, since we can't have some DOMExceptions inheriting from 
SyntaxError.prototype and others from Error.prototype.)

If they do remain separate, then should new specs that are throwing an 
exception due to a syntax error prefer to throw the "SyntaxError" 
DOMException or the built-in SyntaxError?  I think I have a slight 
preference for the built-in one, just so we can avoid code properties in 
a few more places.
Received on Thursday, 26 April 2012 23:49:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:09 GMT