summaryrefslogtreecommitdiff
path: root/js/src/builtin
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-06-08 16:51:29 -0400
committerGaming4JC <g4jc@hyperbola.info>2019-07-18 22:38:19 -0400
commitafb28a43d481075a244b0e18faa8447dfadacf8f (patch)
tree5a820425685c2e9986ae34bf9e6325314e3b72a0 /js/src/builtin
parentadc81d634d12d58a64e0d2a1e95998b766cf6e96 (diff)
downloaduxp-afb28a43d481075a244b0e18faa8447dfadacf8f.tar.gz
1317375 - Implement "Template Literals Revision / Lifting Template Literal Restriction" ECMAScript proposal
Diffstat (limited to 'js/src/builtin')
-rw-r--r--js/src/builtin/ReflectParse.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/js/src/builtin/ReflectParse.cpp b/js/src/builtin/ReflectParse.cpp
index 2a0a08a5dc..3495ede2f4 100644
--- a/js/src/builtin/ReflectParse.cpp
+++ b/js/src/builtin/ReflectParse.cpp
@@ -3044,7 +3044,12 @@ ASTSerializer::expression(ParseNode* pn, MutableHandleValue dst)
MOZ_ASSERT(pn->pn_pos.encloses(next->pn_pos));
RootedValue expr(cx);
- expr.setString(next->pn_atom);
+ if (next->isKind(PNK_RAW_UNDEFINED)) {
+ expr.setUndefined();
+ } else {
+ MOZ_ASSERT(next->isKind(PNK_TEMPLATE_STRING));
+ expr.setString(next->pn_atom);
+ }
cooked.infallibleAppend(expr);
}
@@ -3136,6 +3141,7 @@ ASTSerializer::expression(ParseNode* pn, MutableHandleValue dst)
case PNK_TRUE:
case PNK_FALSE:
case PNK_NULL:
+ case PNK_RAW_UNDEFINED:
return literal(pn, dst);
case PNK_YIELD_STAR:
@@ -3276,6 +3282,10 @@ ASTSerializer::literal(ParseNode* pn, MutableHandleValue dst)
val.setNull();
break;
+ case PNK_RAW_UNDEFINED:
+ val.setUndefined();
+ break;
+
case PNK_TRUE:
val.setBoolean(true);
break;