1339395 - Part 2: Add parser support for rest and spread object properties.

This commit is contained in:
Gaming4JC 2019-07-14 16:37:57 -04:00 • committed by Roy Tam
commit 85350c0655
5 changed files with 73 additions and 6 deletions

View file

@ -5815,6 +5815,11 @@ BytecodeEmitter::emitDestructuringOpsObject(ParseNode* pattern, DestructuringFla
return false;
for (ParseNode* member = pattern->pn_head; member; member = member->pn_next) {
if (member->isKind(PNK_SPREAD)) {
// FIXME: Implement
continue;
}
ParseNode* subpattern;
if (member->isKind(PNK_MUTATEPROTO))
subpattern = member->pn_kid;
@ -9449,6 +9454,13 @@ BytecodeEmitter::emitPropertyList(ParseNode* pn, MutableHandlePlainObject objp,
continue;
}
if (propdef->isKind(PNK_SPREAD)) {
MOZ_ASSERT(type == ObjectLiteral);
objp.set(nullptr);
// FIXME: implement
continue;
}
bool extraPop = false;
if (type == ClassBody && propdef->as<ClassMethod>().isStatic()) {
extraPop = true;