tc39 / test262

Official ECMAScript Conformance Test Suite
Other
2.38k stars 461 forks source link

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

Open p-bakker opened 3 years ago

p-bakker commented 3 years ago

Code implementing Bullet 3 - 5 of https://tc39.es/ecma262/#sec-utf16encodecodepoint isn't hit when when a \u{...} unicode escape sequence in the range of 0x10000 through 0x10FFFF is used in a Template Literal

None of the existing tests for (Tagged) Template Literals include a Template Literal with a unicode escape sequence in that range

p-bakker commented 3 years ago

Test could be something like

(function(str) {return str[0]})`\u{1F680}` === '🚀'

Happy to create a PR, just not sure exactly where to put this test, in a new file or in one of the existing files in /language/expressions/template-literal

jugglinmike commented 3 years ago

Wow, Rhino! Thanks for going the extra mile and letting us know about the missing coverage. If you have the bandwidth, it would be great to get your contribution. If not, I'll gladly write a patch based on your report.

test/language/expressions/template-literal/tv-utf16-escape-sequence.js seems like a logical place for the assertion. I'd also support placing it in a dedicated file--you can only fail a test once, after all.