summaryrefslogtreecommitdiffstats
path: root/js/src/frontend/FullParseHandler.h
diff options
context:
space:
mode:
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)
{