@@ -3297,6 +3297,9 @@ ParseNodePtr Parser::ParseTerm(BOOL fAllowCall,
3297
3297
// Super call needs to reference 'new.target'
3298
3298
if (pid == wellKnownPropertyPids._superConstructor)
3299
3299
{
3300
+ // super() will write to "this", so track the assignment.
3301
+ PidRefStack *thisRef = wellKnownPropertyPids._this->GetTopRef();
3302
+ thisRef->isAsg = true;
3300
3303
ReferenceSpecialName(wellKnownPropertyPids._newTarget, ichMin, ichLim);
3301
3304
}
3302
3305
@@ -10287,7 +10290,9 @@ ParseNodePtr Parser::ParseStatement()
10287
10290
}
10288
10291
else
10289
10292
{
10290
- pnodeT = ParseExpr<buildAST>(koplNo, &fCanAssign, /*fAllowIn = */FALSE);
10293
+ IdentToken token;
10294
+ pnodeT = ParseExpr<buildAST>(koplNo, &fCanAssign, /*fAllowIn = */FALSE, FALSE, NULL, nullptr, nullptr, &token);
10295
+ TrackAssignment<buildAST>(pnodeT, &token);
10291
10296
}
10292
10297
10293
10298
// We would veryfiy the grammar as destructuring grammar only when for..in/of case. As in the native for loop case the above ParseExpr call
@@ -12848,10 +12853,6 @@ ParseNodePtr Parser::ConvertArrayToArrayPattern(ParseNodePtr pnode)
12848
12853
{
12849
12854
*itemRef = ConvertObjectToObjectPattern(item);
12850
12855
}
12851
- else if (item->nop == knopName)
12852
- {
12853
- TrackAssignment<true>(item, nullptr);
12854
- }
12855
12856
});
12856
12857
12857
12858
return pnode;
@@ -12888,11 +12889,7 @@ ParseNodePtr Parser::GetRightSideNodeFromPattern(ParseNodePtr pnode)
12888
12889
else
12889
12890
{
12890
12891
rightNode = pnode;
12891
- if (op == knopName)
12892
- {
12893
- TrackAssignment<true>(pnode, nullptr);
12894
- }
12895
- else if (op == knopAsg)
12892
+ if (op == knopAsg)
12896
12893
{
12897
12894
TrackAssignment<true>(pnode->AsParseNodeBin()->pnode1, nullptr);
12898
12895
}
@@ -13200,6 +13197,8 @@ ParseNodePtr Parser::ParseDestructuredVarDecl(tokens declarationType, bool isDec
13200
13197
Error(ERRInvalidAssignmentTarget);
13201
13198
}
13202
13199
13200
+ TrackAssignment<buildAST>(pnodeElem, &token);
13201
+
13203
13202
if (buildAST)
13204
13203
{
13205
13204
if (IsStrictMode() && pnodeElem != nullptr && pnodeElem->nop == knopName)
0 commit comments