Skip to content

Node.js debugger does not show object members with duplicate values #987

@walkswiththebear

Description

@walkswiththebear

I'm using CodeLite 9.02 under Linux-Ubuntu 15.10. Define this object:

var debuggerTestObject = {
    firstBoolean : true,
    secondBoolean : true,
    thirdBoolean: false,
    fourthBoolean: false,
    firstInt: 42,
    secondInt: 43,
    thirdInt: 42,
    fourthInt: 43
};

Then add a line where you can set a breakpoint and watch the object debuggerTestObject, like this:

console.log(debuggerTestObject.firstBoolean);

The debugger (both debugger pane and mouseover pop-up window) will show the following members for the object:

firstBoolean = true,
thirdBoolean = false,
firstInt = 42,
secondInt = 43,

What's happening here is that those object members that were intialized to the same value as a previous member are ignored by the debugger. If you change the value of an ignored member later to some other value that is not in use, that member will show up. For example:

debuggerTestObject.thirdInt = 44;
console.log(debuggerTestObject.thirdInt);

Now the member thirdInt will show up in the debugger.

This behavior is happens not only for object literals, but also for objects created with new.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions