Re: [heycam/webidl] Re-align DOMException objects with what is implemented (#378)

Some comments based on comparing to Gecko's IDL:

1. Gecko has `[LenientThis]` on the `message` and `name` attributes, with a comment about how otherwise doing `DOMException.prototype.toString()` will throw, because `Error.prototype.toString` accesses `.message` and `.name` on `this`.  Then again, looks like other browsers throw on `DOMException.prototype.toString()` (or more likely code like `alert(obj)` when `obj` happens to be `DOMException.prototype`) anyway...  

2. In Gecko DOMException does not implement a stringifier; it picks up the default Error.prototype.toString.  So if you do `String(new DOMException("a", "b"))` you get `"b: a"`.  Looks like you just changed the stringifier to do that, but I guess I'm saying we don't really need a custom stringifier at all, unless we want to do the Safari thing.

3. Minor nit: missing space after `=` for NO_MODIFICATION_ALLOWED_ERR.

4. Gecko documents some of the error constants as "historical": DOMSTRING_SIZE_ERR, NO_DATA_ALLOWED_ERR, INUSE_ATTRIBUTE_ERR, VALIDATION_ERR, TYPE_MISMATCH_ERR.  Not sure what that means in practice.

Thank you for doing this!


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/378#issuecomment-311731702

Received on Wednesday, 28 June 2017 17:32:35 UTC