summaryrefslogtreecommitdiffstats
path: root/js/src/frontend/FullParseHandler.h
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-07-14 16:37:57 -0400
committerGaming4JC <g4jc@hyperbola.info>2019-07-18 22:38:47 -0400
commit091d00f1bd22f821d3926c46dd1d6cf7fbc746f4 (patch)
treec68c6e96a4104ed0a78807c79f3601cd6f3eee4e /js/src/frontend/FullParseHandler.h
parent638a904d0dbe4bcc5a625ea472c7e65ac75dbc06 (diff)
downloadUXP-091d00f1bd22f821d3926c46dd1d6cf7fbc746f4.tar
UXP-091d00f1bd22f821d3926c46dd1d6cf7fbc746f4.tar.gz
UXP-091d00f1bd22f821d3926c46dd1d6cf7fbc746f4.tar.lz
UXP-091d00f1bd22f821d3926c46dd1d6cf7fbc746f4.tar.xz
UXP-091d00f1bd22f821d3926c46dd1d6cf7fbc746f4.zip
1339395 - Part 2: Add parser support for rest and spread object properties.
Diffstat (limited to 'js/src/frontend/FullParseHandler.h')
-rw-r--r--js/src/frontend/FullParseHandler.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/js/src/frontend/FullParseHandler.h b/js/src/frontend/FullParseHandler.h
index d34cdf43d..2d7f57e1e 100644
--- a/js/src/frontend/FullParseHandler.h
+++ b/js/src/frontend/FullParseHandler.h
@@ -395,6 +395,18 @@ class FullParseHandler
return true;
}
+ MOZ_MUST_USE bool addSpreadProperty(ParseNode* literal, uint32_t begin, ParseNode* inner) {
+ MOZ_ASSERT(literal->isKind(PNK_OBJECT));
+ MOZ_ASSERT(literal->isArity(PN_LIST));
+
+ setListFlag(literal, PNX_NONCONST);
+ ParseNode* spread = newSpread(begin, inner);
+ if (!spread)
+ return false;
+ literal->append(spread);
+ return true;
+ }
+
MOZ_MUST_USE bool addObjectMethodDefinition(ParseNode* literal, ParseNode* key, ParseNode* fn,
JSOp op)
{