New issue
Advanced search Search tips

Issue 2822 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Nov 2014
HW: ----
NextAction: ----
OS: ----
Priority: ----
Type: ----

issue chromium:228909

Sign in to add a comment

Messages generated from custom error events stringify as "[object Object]".

Project Member Reported by, Aug 2 2013

Issue description

Copied from 


UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31

Steps to reproduce the problem:
1. Go to this url:
2. Look at the "result" panel.

What is the expected behavior?
Should see "MyError: foo" there. 

What went wrong?
I see "Uncaught [object Object]" there.

Looks like when an error is thrown which inherits from Error, when the error is reported to window.onerror or console or developer tools, something goes wrong when creating a string representation of the error object.

Did this work before? Yes I detected the issue on the 4 Feb 2013, Chrome 25.

Chrome version: 26.0.1410.43  Channel: stable
OS Version: OS X 10.8.3

I'm not familiar with the v8/Chromium codebase but my guess is that the problem is around here:

Comment 1 by, Aug 2 2013

Blocking: chromium:228909

Comment 2 by, Aug 2 2013

In a nutshell, it's fairly common for folks to fake inheritance via `Subclass.prototype = new Superclass();`. Handlebars does this, and it's been recommended by people who probably now know better: for example.

V8 supports `subclass.prototype = Object.create(superclass.prototype);` perfectly, as well as the similar mechanism that Closure uses in 'goog.inherit' ( It falls down with this simpler sample, however.
Status: Fixed
Status: New
Status: Fixed

Comment 7 by, Apr 18 2016

Blocking: chromium:228909

Sign in to add a comment