Skip to content

Support Symbol.toStringTag class fields and getters - #2037

Merged
ctate merged 3 commits into
mainfrom
ctate/support-symbol-tostringtag-383f71
Oct 24, 2026
Merged

ctate merged 3 commits into
mainfrom
ctate/support-symbol-tostringtag-383f71

Conversation

@ctate

@ctate ctate commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator
  • Classes can declare [Symbol.toStringTag] = "Name" (lru-cache does) or a get [Symbol.toStringTag]() getter. String(), template literals, Object.prototype.toString and console.log print the tag as Node does, including for values typed unknown.
  • Of 3,877 corpus programs, only 3 emit different instructions; the rest are unchanged apart from a new null slot in the class ops tables.

@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
scriptc Ready Ready Preview, v0 Oct 24, 2026 4:50am UTC

Comment thread packages/compiler/src/frontend/lowering/lower-inspect.ts Outdated
Comment thread packages/compiler/src/frontend/lowering/class-to-primitive.ts
Comment thread packages/runtime/src/scr_json.c Outdated
@ctate
ctate merged commit 1e90263 into main Oct 24, 2026
62 of 65 checks passed
@ctate
ctate deleted the ctate/support-symbol-tostringtag-383f71 branch October 24, 2026 06:21

This branch was successfully deployed

1 active deployment
Preview — cbb87e88 Deployed Oct 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant