diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index 970eae08129..0c986aa5df0 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -2926,10 +2926,7 @@ Parser::bindDestructuringLHS(ParseNode *pn) switch (pn->getKind()) { case PNK_NAME: pn->markAsAssigned(); - /* FALL THROUGH */ - case PNK_DOT: - case PNK_ELEM: /* * We may be called on a name node that has already been specialized, * in the very weird and ECMA-262-required "for (var [x] = i in o) ..." @@ -2939,6 +2936,10 @@ Parser::bindDestructuringLHS(ParseNode *pn) pn->setOp(JSOP_SETNAME); break; + case PNK_DOT: + case PNK_ELEM: + break; + case PNK_CALL: if (!makeSetCall(pn, JSMSG_BAD_LEFTSIDE_OF_ASS)) return false; @@ -5077,12 +5078,11 @@ Parser::checkAndMarkAsAssignmentLhs(ParseNode *pn, bool isPlai pn->setOp(pn->isOp(JSOP_GETLOCAL) ? JSOP_SETLOCAL : JSOP_SETNAME); pn->markAsAssigned(); break; + case PNK_DOT: - pn->setOp(JSOP_SETPROP); - break; case PNK_ELEM: - pn->setOp(JSOP_SETELEM); break; + #if JS_HAS_DESTRUCTURING case PNK_ARRAY: case PNK_OBJECT: @@ -5094,10 +5094,12 @@ Parser::checkAndMarkAsAssignmentLhs(ParseNode *pn, bool isPlai return false; break; #endif + case PNK_CALL: if (!makeSetCall(pn, JSMSG_BAD_LEFTSIDE_OF_ASS)) return false; break; + default: report(ParseError, false, null(), JSMSG_BAD_LEFTSIDE_OF_ASS); return false;