I was playing around today when I noticed that some of my objects in Chrome's console were being displayed as Object
instead of the constructor function name.
This was odd, so I boiled it down to the following code:
function Baz() {
this.baz = true;
}
var b = new Baz();
var c = Object.create(b);
console.log(b); // why is b outputting with Object not Baz?
In the above code b
, is not created via a Object.create
and yet when logged it says Object. I don't have a typo there, and mistakenly asking about c. The log of b has been altered when I haven't even touched that object. Creating another instance c
, should not alter b
.
This has to be a Chrome bug right? Is there anyway to get Chrome to correctly report Baz
here?
This is important for debugging purposes.
UPDATE Bug filed: https://code.google.com/p/chromium/issues/detail?id=478522