New issue
Advanced search Search tips
Starred by 4 users
Status: Fixed
Closed: Jun 2015
HW: ----
NextAction: ----
OS: ----
Priority: ----
Type: ----

Sign in to add a comment
Error.toString() throws illegal access
Reported by, Nov 8 2012 Back to list
e = new Error();
e.type = 'foo';

Throws "illegal access"

Status: Assigned
Thanks for reporting this. We are working towards resolving this.
The immediate issue has been solved, though the 'type' and 'arguments' properties should not be set for Error objects.
Comment 3 by, May 28 2015
This seems to be resolved, can it be closed?
Status: Fixed
Comment 5 by, Jul 29 2015
Thanks for fixing.  Could you speak a little more to "'type' and 'arguments' properties should not be set for Error objects"?  It doesn't seem to be widely known in the javascript community.  Several library authors have used 'type' before this issue surfaced:

And there's no mention of these properties being special on MDN:

Should I be discouraging folks from using 'type', or is safe with this fix?  
"type" and "arguments" were special properties used internally by V8. That was a bug that has been fixed. They are no longer used internally so it should be fine to set and use them on Error objects.
Comment 7 by, Jul 30 2015
Good to know, thanks!
Sign in to add a comment