On Wed, Aug 21, 2013 at 12:21 PM, Domenic Denicola
<[email protected]> wrote:
> FWIW for non-DOM code I see people using `instanceof` much more often than 
> checking `name`.
>
> Thus I personally think that creating a bunch of new `DOMException` subtypes 
> would be the way to go, e.g. a `PermissionDeniedError` whose `.name` is 
> `PermissionDeniedError` and whose `.__proto__` is `DOMException`.
>
> If we were starting from scratch we'd probably just have a single 
> `DOMException` (probably named `DOMError` actually) with a `.code` property 
> that can vary between types of errors.

`.code` implies numeric error codes which has gone out of fashion.

-- 
erik
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to