Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

debugger shows javascript object properties with getters as undefined #14

Closed
@weinand

Description

@weinand

Objects that have properties with getters / setters incorrectly display the value of the properties as 'undefined'. (See first attached screenshot, 'object3.myprop'). This leads to confusing debugging sessions. In contrast, the Chrome debugger makes it clear that there is a getter which would be invoked. (See second screenshot).

Suprisingly, object properties that have a numeric name will automatically invoke the getter function and display its value (First attached screenshot, 'object4.4').

Note that evaluating the property will yield the value '3' correctly in both cases.

The test code is:

var object3 = {};
Object.defineProperty(object3, "myprop", {
enumerable: true,
configurable: true,
get: function() { return 3; },
set: function(x) { }
});

And for the numeric property:

var object4 = {};
Object.defineProperty(object4, "4", {
enumerable: true,
configurable: true,
get: function() { return 3; },
set: function(x) { }
});

Is it possible to influence how properties with a getter are displayed in the debugger? Or to at least avoid that they are displayed as just 'undefined'.

Thanks in advance!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions