Object.create alters console output of proto object in Chrome? Object.create alters console output of proto object in Chrome? google-chrome google-chrome

Object.create alters console output of proto object in Chrome?


Update: This is indeed a regression between Chrome 41 and Chrome 42. It's being tracked here: http://crbug.com/478522

Chrome 41's output:enter image description here

Chrome 42's output:

They've made improvements to syntax highlighting as you type in the dev tools and this probably broke. I've pinged a friend who is deeply involved with the dev tools. Nice find.


No. The problem you describe is very real.

Objects created with constructors will have their name displayed when logging them and generally better debugging experience in Chrome (and in node/io.js).

For this reason - I avoid Object.create for prototypical inheritance in my own code although I prefer it conceptually.

I think you understand this - but I still want to clarify for future readers. Note that the inheritance still happens with the Object.create version - the only difference is in how the object is logged and treated in the debugger.