Skip to content

inspect objects with "Symbol" attributes #156

Closed
@mmarchini

Description

@mmarchini

Inspect commands can't handle Symbol attributes (e.g. @@toStringTag and @@unscopable), resulting in <non-string> properties.

For example, the following code uses the @@toStringTag symbol:

class Bar {
  constructor() {
    this[Symbol.toStringTag] = "Bar";
  }
}

let bar = new Bar();

If we use llnode to find out the properties for bar, it will give the following output:

(lldb) v8 findjsinstances -v Bar
0x0000015078184729:<Object: Bar properties {
    .constructor=0x00000150781846e1:<function: Bar at index.js:17:14>}>
0x0000015078184949:<Object: Bar properties {
    .<non-string>=0x00002d2064acb1e1:<String: "Bar">}>

As you can see, there's a <non-string> property instead of our symbol.

I was looking at llnode and V8 code to try to find a solution, but I'm not sure how to implement it. Did anyone try this before?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions