If you evaluate this in the Reps test app :
x = { y: 0 }; Object.defineProperty(x, 'y', { get: function() { return 0; } });
it renders as :
- TINY
Object
- SHORT
Object { y: Object }
- Long
Object { y: Object }
In the old console, this was displayed like Object { y: Getter } which reflect better the shape of the object.
We should do the same in Reps.
The grip we got when evaluating x = { y: 0 }; Object.defineProperty(x, 'y', { get: function() { return 0; } }); is :
{
"from": "server1.conn8.child1/consoleActor2",
"input": " x = { y: 0 }; Object.defineProperty(x, 'y', { get: function() { return 0; } });",
"result": {
"type": "object",
"actor": "server1.conn8.child1/obj43",
"class": "Object",
"extensible": true,
"frozen": false,
"sealed": false,
"ownPropertyLength": 1,
"preview": {
"kind": "Object",
"ownProperties": {
"y": {
"configurable": true,
"enumerable": true,
"get": {
"type": "object",
"actor": "server1.conn8.child1/obj44",
"class": "Function",
"extensible": true,
"frozen": false,
"sealed": false,
"displayName": "get",
"location": {
"url": "debugger eval code",
"line": 1
}
},
"set": {
"type": "undefined"
}
}
},
"ownPropertiesLength": 1,
"safeGetterValues": {}
}
},
"timestamp": 1493218529771,
"exception": null,
"frame": null,
"helperResult": null
}
This contains all the information we need to display properly that a property has a getter.
If you evaluate this in the Reps test app :
it renders as :
ObjectObject { y: Object }Object { y: Object }In the old console, this was displayed like
Object { y: Getter }which reflect better the shape of the object.We should do the same in Reps.
The grip we got when evaluating
x = { y: 0 }; Object.defineProperty(x, 'y', { get: function() { return 0; } });is :This contains all the information we need to display properly that a property has a getter.