Skip to content

Add template literal tests for supplementary-plane unicode escape sequences - #5105

Open
hexbinoct wants to merge 1 commit into
tc39:mainfrom
hexbinoct:template-literal-supplementary-tv
Open

Add template literal tests for supplementary-plane unicode escape sequences#5105
hexbinoct wants to merge 1 commit into
tc39:mainfrom
hexbinoct:template-literal-supplementary-tv

Conversation

@hexbinoct

Copy link
Copy Markdown

Closes #3001.

Template literals had no coverage for \u{} escapes above U+FFFF, so the surrogate pair branch of UTF16EncodeCodePoint (steps 3 to 5) was never exercised. The only astral escapes in these tests today are the invalid seven-digit \u{10FFFFF} cases.

The new file checks the cooked and raw values of tagged templates for U+10000 (the first code point that needs a surrogate pair), U+10437 (the character the spec itself uses as its UTF-16 example), U+10FFFF (the largest code point), and a leading-zeros form, plus the untagged path and concatenation with adjacent template characters. Expected values are written as explicit \uD800\uDC00 style pairs so they do not depend on the construct under test.

Following jugglinmike's suggestion in the issue, the assertions live in a dedicated file next to tv-utf16-escape-sequence.js. Thanks to p-bakker for reporting the gap from their work on Rhino.

The copyright line says hexbinoct. Happy to swap in the legal name from the CLA if that is preferred.

@hexbinoct
hexbinoct requested a review from a team as a code owner August 13, 2026 06:37
@ptomato

ptomato commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Thanks!

Totally separate from a code review, I don't know the answer to the copyright name question.

@bakkot

bakkot commented Aug 13, 2026

Copy link
Copy Markdown
Member

My understanding is that the copyright notice isn't actually the thing that creates the copyright; it's mainly to track provenance as things get copied to new places, and to ensure you get credit. So your username should be OK if that's what you'd prefer. We already have some tests with just usernames.

Incidentally US law explicitly allows using "a generally known alternative designation of the owner" in a copyright notice, though I don't know about other countries.

@hexbinoct

Copy link
Copy Markdown
Author

Thanks both, I will leave the copyright line as hexbinoct, and the prop-desc.js precedent is a useful one to have on record.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test missing for \u{10000} ... \u{10FFFF} in Template Literals

3 participants