Unable to see the __proto__ chain in the debugger for objects with parent/prototype Object.create(null).

8 views
Skip to first unread message

exercising camel

unread,
Jul 8, 2015, 10:44:52 PM7/8/15
to google-chrome-...@googlegroups.com
It seems that the debugger doesn't show the __proto__ slot/property for objects that have a parent of Object.create(null) in their prototype chain.


window.onload = function() {
   
'use strict';

   
var parent = Object.create(null);    // we can not see the __proto__ slot
//     var parent = Object.create({});   // we can     see the __proto__ slot
    parent
.x   = [3];
    parent
.inc = function() { this.x[0] += 1; };

   
var self = Object.create(parent);
   
self.inc();

   
// correctly outputs 4 but we can't see the __proto__
   
// slot when debugging (by hovering the mouse over the variable self);
   
// the same is true about  browsing the 'Local scope' and the console.dir() method
    console
.log(self.x[0]); // 4
};




Reply all
Reply to author
Forward
0 new messages