Skip to content

Symbol.isStringTag shows as undefined #1525

Closed
@pflannery

Description

When trying to evaluate Symbol.toStringTag in the debug variables section the value is shown as undefined
image

but it's not actually undefined when I run new TestPropertyType()[Symbol.toStringTag] in the debug console.

image
image

I think this is happening because vscode (or node?) is treating it as a function because the tooltip in the debug variable section shows the word function

Just clarify Mozilla states we can use getters for Symbol.toStringTag
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag

// contrived class example
class TestPropertyType {
  constructor(args) {  }
  get [Symbol.toStringTag]() {
    return TestPropertyType.name;
  }
}

VS Code Version: 1.74.3
Node Version: 18.13.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions