class Es6TemplateLiterals
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
TEMPLATELIT_VAR |
Constructor and Description |
---|
Es6TemplateLiterals() |
Modifier and Type | Method and Description |
---|---|
private static java.lang.String |
cookString(java.lang.String s)
Takes a raw string and returns a string that is suitable for the cooked
value (the Template Value or TV as described in the specs).
|
private static Node |
createCookedStringArray(Node n) |
private static Node |
createRawStringArray(Node n) |
(package private) static void |
visitTaggedTemplateLiteral(NodeTraversal t,
Node n)
Converts tag`a\tb${bar}` to:
// A global (module) scoped variable
var $jscomp$templatelit$0 = ["a\tb"]; // cooked string array
$jscomp$templatelit$0.raw = ["a\\tb"]; // raw string array
...
|
(package private) static void |
visitTemplateLiteral(NodeTraversal t,
Node n)
Converts `${a} b ${c} d ${e}` to (a + " b " + c + " d " + e)
|
private static final java.lang.String TEMPLATELIT_VAR
static void visitTemplateLiteral(NodeTraversal t, Node n)
n
- A TEMPLATELIT node that is not prefixed with a tagstatic void visitTaggedTemplateLiteral(NodeTraversal t, Node n)
n
- A TAGGED_TEMPLATELIT nodeprivate static java.lang.String cookString(java.lang.String s)