Closed
Description
opened on Jan 20, 2023
When trying to evaluate Symbol.toStringTag
in the debug variables section the value is shown as undefined
but it's not actually undefined when I run new TestPropertyType()[Symbol.toStringTag]
in the debug console.
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