@@ -13102,6 +13102,7 @@ ParseNodePtr Parser::ParseDestructuredVarDecl(tokens declarationType, bool isDec
13102
13102
ParseNodePtr pnodeElem = nullptr;
13103
13103
int parenCount = 0;
13104
13104
bool seenRest = false;
13105
+ IdentToken token;
13105
13106
13106
13107
// Save the Block ID prior to the increments, so we can restore it back.
13107
13108
int originalCurrentBlockId = GetCurrentBlock()->blockId;
@@ -13173,7 +13174,6 @@ ParseNodePtr Parser::ParseDestructuredVarDecl(tokens declarationType, bool isDec
13173
13174
if (!isDecl)
13174
13175
{
13175
13176
BOOL fCanAssign;
13176
- IdentToken token;
13177
13177
// Look for postfix operator
13178
13178
pnodeElem = ParsePostfixOperators<buildAST>(pnodeElem, TRUE, FALSE, FALSE, TRUE, &fCanAssign, &token);
13179
13179
}
@@ -13190,7 +13190,6 @@ ParseNodePtr Parser::ParseDestructuredVarDecl(tokens declarationType, bool isDec
13190
13190
else
13191
13191
{
13192
13192
BOOL fCanAssign;
13193
- IdentToken token;
13194
13193
// We aren't declaring anything, so scan the ID reference manually.
13195
13194
pnodeElem = ParseTerm<buildAST>(/* fAllowCall */ m_token.tk != tkSUPER, nullptr /*pNameHint*/, nullptr /*pHintLength*/, nullptr /*pShortNameOffset*/, &token, false,
13196
13195
FALSE, &fCanAssign);
@@ -13202,7 +13201,10 @@ ParseNodePtr Parser::ParseDestructuredVarDecl(tokens declarationType, bool isDec
13202
13201
Error(ERRInvalidAssignmentTarget);
13203
13202
}
13204
13203
13205
- TrackAssignment<buildAST>(pnodeElem, &token);
13204
+ if (buildAST)
13205
+ {
13206
+ TrackAssignment<buildAST>(pnodeElem, nullptr);
13207
+ }
13206
13208
13207
13209
if (buildAST)
13208
13210
{
@@ -13217,7 +13219,6 @@ ParseNodePtr Parser::ParseDestructuredVarDecl(tokens declarationType, bool isDec
13217
13219
{
13218
13220
CheckStrictModeEvalArgumentsUsage(token.pid);
13219
13221
}
13220
- token.tk = tkNone;
13221
13222
}
13222
13223
}
13223
13224
}
@@ -13292,6 +13293,11 @@ ParseNodePtr Parser::ParseDestructuredVarDecl(tokens declarationType, bool isDec
13292
13293
Error(ERRsyntax);
13293
13294
}
13294
13295
13296
+ if (!buildAST && token.tk == tkID)
13297
+ {
13298
+ TrackAssignment<buildAST>(nullptr, &token);
13299
+ }
13300
+
13295
13301
return pnodeElem;
13296
13302
}
13297
13303
0 commit comments