Editorial: Simplify TV and TRV #4084
The rendered spec preview for this PR is available as a single page at https://tc39.es/ecma262/pr/4084 and as multiple pages at https://tc39.es/ecma262/pr/4084/multipage .
<hidden purpose="for-rewritable-pr-comment-action-use" value="tc39_pr_preview_comment"></hidden>
UTF16EncodeCodePoint is just an AO, can we call it as such?
1. Return UTF16EncodeCodePoint(the single code point matched by |LineTerminatorSequence|).
1. Return UTF16EncodeCodePoint(the single code point matched by |TemplateCharacter|).
This AO is not just an alias for TV, can we remove it? (or rename TV to TemplateString)
tv1/tv2 being undefined already imply that _escapes_ is cooked, so this should be enough:
1. If _tv1_ is *undefined* or _tv2_ is *undefined*, return *undefined*.
Or
1. If _tv1_ is *undefined* or _tv2_ is *undefined*, then
1. Assert: _escapes_ is ~cooked~.
1. Return *undefined*.
I don't think we need the lookahead restriction here in the SDO, since the SDOs apply on an already parsed tree
Yes, but upon further reflection I actually think CodePointsToString would be even better. Updated.
Done.
You're right, but they are valid AFAIK—and are potentially clarifying in this context (see also IsCharacterClass and CharacterValue).
Approved these changes.
nicolo-ribaudo
gibson042
Extends #4082
Merge TV and TRV into a single parameterized TV
Remove deep traversal by leveraging CodePointsToString