Open Bug 871985 Opened 9 years ago Updated 2 years ago

Make safe getter value descriptors more like regular data descriptors


(DevTools :: Debugger, task, P5)



(Not tracked)


(Reporter: past, Unassigned)


(Blocks 1 open bug)


In the remote debugging protocol a data descriptor looks like this:

"b": {
  "value": "beta",
  "enumerable": true,
  "configurable": false,
  "writable": true

Safe getter value descriptors however are currently like this:

"localName": {
  "getterValue": "p",
  "getterPrototypeLevel": 4,
  "enumerable": true,
  "writable": true

I propose that we make them look more like regular data descriptors, with a single additional property, |getterPrototypeLevel|:

"localName": {
  "value": "p",
  "enumerable": true,
  "configurable": true,
  "writable": true,
  "getterPrototypeLevel": 4

This has the benefit that client code doesn't have to handle these new descriptors specially, and displaying an object's properties in the traditional way is just a matter of merging the contents of |ownProperties| and |safeGetterValues|. It seems like adding |configurable| is a no-brainer and converting |getterValue| to |value| is net positive, since there is no ambiguity that this value was obtained by a getter (from the |getterPrototypeLevel| property and from the location of the descriptor inside the |safeGetterValues| dictionary.
Component: Developer Tools: Console → Developer Tools: Debugger
Summary: Make safe getter value descriptors more alike regular data descriptors → Make safe getter value descriptors more like regular data descriptors
Priority: -- → P3
Perhaps presence of a setter can be used to determine writability as well.
Product: Firefox → DevTools

I believe this might have been fixed. CC nicolas.

Blocks: dbg-server
Type: defect → task
Flags: needinfo?(nchevobbe)
Priority: P3 → P5

We still have the structure described in Comment 0 : devtools/server/actors/object.js#414-419

Flags: needinfo?(nchevobbe)
You need to log in before you can comment on or make changes to this bug.