Skip to content
This repository was archived by the owner on May 2, 2018. It is now read-only.
This repository was archived by the owner on May 2, 2018. It is now read-only.

Display getter function on Objects #138

@nchevobbe

Description

@nchevobbe

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions