Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ErrorEvent error attribute too limiting for the errors we use #336

Closed
jan-ivar opened this issue Mar 31, 2016 · 2 comments
Closed

ErrorEvent error attribute too limiting for the errors we use #336

jan-ivar opened this issue Mar 31, 2016 · 2 comments

Comments

@jan-ivar
Copy link
Member

The current type of the ErrorEvent's error attribute is Error which is too limiting for the errors we want to use, like SecurityError.

It does the wrong thing, as can be seen here:

let errors = [
  new DOMException("The operation is not secure", "SecurityError"),
  new Error("SecurityError"),
];
console.log(errors.map(e => e.name)); // SecurityError,Error

Solved by #335 and any.

@jan-ivar
Copy link
Member Author

jan-ivar commented Apr 2, 2016

TIL that Error does in fact have a name field, just not a constructor for it. Who knew?

Even so, by going with the html one, we can throw whatever, be it Error, TypeError etc. or DOMException, we're not limited.

@jan-ivar
Copy link
Member Author

Closing this in favor of #337. Can reopen if the other one fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant