@@ -13102,6 +13102,7 @@ ParseNodePtr Parser::ParseDestructuredVarDecl(tokens declarationType, bool isDec
1310213102 ParseNodePtr pnodeElem = nullptr;
1310313103 int parenCount = 0;
1310413104 bool seenRest = false;
13105+ IdentToken token;
1310513106
1310613107 // Save the Block ID prior to the increments, so we can restore it back.
1310713108 int originalCurrentBlockId = GetCurrentBlock()->blockId;
@@ -13173,7 +13174,6 @@ ParseNodePtr Parser::ParseDestructuredVarDecl(tokens declarationType, bool isDec
1317313174 if (!isDecl)
1317413175 {
1317513176 BOOL fCanAssign;
13176- IdentToken token;
1317713177 // Look for postfix operator
1317813178 pnodeElem = ParsePostfixOperators<buildAST>(pnodeElem, TRUE, FALSE, FALSE, TRUE, &fCanAssign, &token);
1317913179 }
@@ -13190,7 +13190,6 @@ ParseNodePtr Parser::ParseDestructuredVarDecl(tokens declarationType, bool isDec
1319013190 else
1319113191 {
1319213192 BOOL fCanAssign;
13193- IdentToken token;
1319413193 // We aren't declaring anything, so scan the ID reference manually.
1319513194 pnodeElem = ParseTerm<buildAST>(/* fAllowCall */ m_token.tk != tkSUPER, nullptr /*pNameHint*/, nullptr /*pHintLength*/, nullptr /*pShortNameOffset*/, &token, false,
1319613195 FALSE, &fCanAssign);
@@ -13202,7 +13201,10 @@ ParseNodePtr Parser::ParseDestructuredVarDecl(tokens declarationType, bool isDec
1320213201 Error(ERRInvalidAssignmentTarget);
1320313202 }
1320413203
13205- TrackAssignment<buildAST>(pnodeElem, &token);
13204+ if (buildAST)
13205+ {
13206+ TrackAssignment<buildAST>(pnodeElem, nullptr);
13207+ }
1320613208
1320713209 if (buildAST)
1320813210 {
@@ -13217,7 +13219,6 @@ ParseNodePtr Parser::ParseDestructuredVarDecl(tokens declarationType, bool isDec
1321713219 {
1321813220 CheckStrictModeEvalArgumentsUsage(token.pid);
1321913221 }
13220- token.tk = tkNone;
1322113222 }
1322213223 }
1322313224 }
@@ -13292,6 +13293,11 @@ ParseNodePtr Parser::ParseDestructuredVarDecl(tokens declarationType, bool isDec
1329213293 Error(ERRsyntax);
1329313294 }
1329413295
13296+ if (!buildAST && token.tk == tkID)
13297+ {
13298+ TrackAssignment<buildAST>(nullptr, &token);
13299+ }
13300+
1329513301 return pnodeElem;
1329613302}
1329713303
0 commit comments