Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError when console.log a static property name in class #42773

Closed
regseb opened this issue Apr 18, 2022 · 2 comments
Closed

TypeError when console.log a static property name in class #42773

regseb opened this issue Apr 18, 2022 · 2 comments
Labels
util Issues and PRs related to the built-in util module.

Comments

@regseb
Copy link
Contributor

regseb commented Apr 18, 2022

Version

v16.14.2

Platform

Linux regseblaptop 5.4.0-107-generic #121-Ubuntu SMP Thu Mar 24 16:04:27 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

node -e "console.log(new class { static name = Symbol(); })"

How often does it reproduce? Is there a required condition?

The property must be static and called name.

What is the expected behavior?

{}

What do you see instead?

node:internal/util/inspect:684
  return `${constructor}${size} `;
  ^

TypeError: Cannot convert a Symbol value to a string
    at getPrefix (node:internal/util/inspect:684:3)
    at getCtxStyle (node:internal/util/inspect:724:10)
    at formatRaw (node:internal/util/inspect:1008:19)
    at formatValue (node:internal/util/inspect:817:10)
    at inspect (node:internal/util/inspect:347:10)
    at formatWithOptionsInternal (node:internal/util/inspect:2167:40)
    at formatWithOptions (node:internal/util/inspect:2029:10)
    at console.value (node:internal/console/constructor:324:14)
    at console.log (node:internal/console/constructor:360:61)
    at [eval]:1:9

Additional information

No response

@targos targos added the util Issues and PRs related to the built-in util module. label Apr 18, 2022
@cola119
Copy link
Member

cola119 commented Apr 18, 2022

I'm working on this.

@panva
Copy link
Member

panva commented Jun 17, 2022

Resolved in 027c288

@panva panva closed this as completed Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants