Compute the template value of a template literal token.
TV(TemplateFull ::= "`" "`")
is the empty array
TV(TemplateFull ::= "`" TemplateCharsEndDelim "`")
is TV(TemplateCharsEndDelim)
TV(TemplateHead ::= "`" "{{")
is the empty array
TV(TemplateHead ::= "`" TemplateCharsEndInterp "{{")
is TV(TemplateCharsEndInterp)
TV(StringTempalteMiddle ::= "}}" "{{")
is the empty array
TV(StringTempalteMiddle ::= "}}" TemplateCharsEndInterp "{{")
is TV(TemplateCharsEndInterp)
TV(StringTempalteTail ::= "}}" "`")
is the empty array
TV(StringTempalteTail ::= "}}" TemplateCharsEndDelim "`")
is TV(TemplateCharsEndDelim)
TV(TemplateCharsEndDelim ::= [^`{\#x03])
is UTF16Encoding(code point of that character)
TV(TemplateCharsEndDelim ::= [^`{\#x03] TemplateCharsEndDelim)
is UTF16Encoding(code point of that character) followed by TV(TemplateCharsEndDelim)
TV(TemplateCharsEndDelim ::= "{"
is 0x7b
TV(TemplateCharsEndDelim ::= "{" [^`{\#x03])
is 0x7b followed by UTF16Encoding(code point of that character)
TV(TemplateCharsEndDelim ::= "{" [^`{\#x03] TemplateCharsEndDelim)
is 0x7b followed by UTF16Encoding(code point of that character) followed by TV(TemplateCharsEndDelim)
TV(TemplateCharsEndDelim ::= "{" "\" [^`#x03])
is 0x7b followed by 0x5c followed by UTF16Encoding(code point of that character)
TV(TemplateCharsEndDelim ::= "{" "\" [^`#x03] TemplateCharsEndDelim)
is 0x7b followed by 0x5c followed by UTF16Encoding(code point of that character) followed by TV(TemplateCharsEndDelim)
TV(TemplateCharsEndDelim ::= "{" "\" "`")
is 0x7b followed by 0x60
TV(TemplateCharsEndDelim ::= "{" "\" "`" TemplateCharsEndDelim)
is 0x7b followed by 0x60 followed by TV(TemplateCharsEndDelim)
TV(TemplateCharsEndDelim ::= "\" [^`#x03])
is 0x5c followed by UTF16Encoding(code point of that character)
TV(TemplateCharsEndDelim ::= "\" [^`#x03] TemplateCharsEndDelim)
is 0x5c followed by UTF16Encoding(code point of that character) followed by TV(TemplateCharsEndDelim)
TV(TemplateCharsEndDelim ::= "\" "`")
is 0x60
TV(TemplateCharsEndDelim ::= "\" "`" TemplateCharsEndDelim)
is 0x60 followed by SVT(TemplateCharsEndDelim)
TV(TemplateCharsEndInterp ::= [^`{\#x03])
is UTF16Encoding(code point of that character)
TV(TemplateCharsEndInterp ::= [^`{\#x03] TemplateCharsEndInterp)
is UTF16Encoding(code point of that character) followed by TV(TemplateCharsEndInterp)
TV(TemplateCharsEndInterp ::= "{" [^`{\#x03])
is 0x7b followed by UTF16Encoding(code point of that character)
TV(TemplateCharsEndInterp ::= "{" [^`{\#x03] TemplateCharsEndInterp)
is 0x7b followed by UTF16Encoding(code point of that character) followed by TV(TemplateCharsEndInterp)
TV(TemplateCharsEndInterp ::= "{" "\" [^`#x03])
is 0x7b followed by 0x5c followed by UTF16Encoding(code point of that character)
TV(TemplateCharsEndInterp ::= "{" "\" [^`#x03] TemplateCharsEndInterp)
is 0x7b followed by 0x5c followed by UTF16Encoding(code point of that character) followed by TV(TemplateCharsEndInterp)
TV(TemplateCharsEndInterp ::= "{" "\" "`")
is 0x7b followed by 0x60
TV(TemplateCharsEndInterp ::= "{" "\" "`" TemplateCharsEndInterp)
is 0x7b followed by 0x60 followed by TV(TemplateCharsEndInterp)
TV(TemplateCharsEndInterp ::= "\")
is 0x5c
TV(TemplateCharsEndInterp ::= "\" [^`#x03])
is 0x5c followed by UTF16Encoding(code point of that character)
TV(TemplateCharsEndInterp ::= "\" [^`#x03] TemplateCharsEndInterp)
is 0x5c followed by UTF16Encoding(code point of that character) followed by TV(TemplateCharsEndInterp)
TV(TemplateCharsEndInterp ::= "\" "`")
is 0x60
TV(TemplateCharsEndInterp ::= "\" "`" TemplateCharsEndInterp)
is 0x60 followed by TV(TemplateCharsEndInterp)
A template literal token is the sequence of characters in the token’s source code, whereas the template value of the template literal is the sequence of Unicode code points that correspond to the characters of the token’s computed value. The process of transforming a “raw” template into a computed template value is sometimes called “cooking”.
When a template is “cooked”, the escape sequence \` will transform into U+0060, a back-tick (technically, “grave accent”), which is the template literal delimiter.
Otherwise, when a backslash precedes any other character, the backslash remains when the template is cooked.
Compute the template value of a template literal token.
where
UTF16Encoding
is the algorithm described by the UTF-16 character encoding.A template literal token is the sequence of characters in the token’s source code, whereas the template value of the template literal is the sequence of Unicode code points that correspond to the characters of the token’s computed value. The process of transforming a “raw” template into a computed template value is sometimes called “cooking”.
When a template is “cooked”, the escape sequence
\`
will transform into U+0060, a back-tick (technically, “grave accent”), which is the template literal delimiter.Otherwise, when a backslash precedes any other character, the backslash remains when the template is cooked.