@@ -3229,6 +3229,9 @@ ParseNodePtr Parser::ParseTerm(BOOL fAllowCall,
3229
3229
// Super call needs to reference 'new.target'
3230
3230
if (pid == wellKnownPropertyPids._superConstructor )
3231
3231
{
3232
+ // super() will write to "this", so track the assignment.
3233
+ PidRefStack *thisRef = wellKnownPropertyPids._this ->GetTopRef ();
3234
+ thisRef->isAsg = true ;
3232
3235
ReferenceSpecialName (wellKnownPropertyPids._newTarget , ichMin, ichLim);
3233
3236
}
3234
3237
@@ -10149,7 +10152,9 @@ ParseNodePtr Parser::ParseStatement()
10149
10152
}
10150
10153
else
10151
10154
{
10152
- pnodeT = ParseExpr<buildAST>(koplNo, &fCanAssign , /* fAllowIn = */ FALSE );
10155
+ IdentToken token;
10156
+ pnodeT = ParseExpr<buildAST>(koplNo, &fCanAssign , /* fAllowIn = */ FALSE , FALSE , NULL , nullptr , nullptr , &token);
10157
+ TrackAssignment<buildAST>(pnodeT, &token);
10153
10158
}
10154
10159
10155
10160
// 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
@@ -12701,10 +12706,6 @@ ParseNodePtr Parser::ConvertArrayToArrayPattern(ParseNodePtr pnode)
12701
12706
{
12702
12707
*itemRef = ConvertObjectToObjectPattern (item);
12703
12708
}
12704
- else if (item->nop == knopName)
12705
- {
12706
- TrackAssignment<true >(item, nullptr );
12707
- }
12708
12709
});
12709
12710
12710
12711
return pnode;
@@ -12741,11 +12742,7 @@ ParseNodePtr Parser::GetRightSideNodeFromPattern(ParseNodePtr pnode)
12741
12742
else
12742
12743
{
12743
12744
rightNode = pnode;
12744
- if (op == knopName)
12745
- {
12746
- TrackAssignment<true >(pnode, nullptr );
12747
- }
12748
- else if (op == knopAsg)
12745
+ if (op == knopAsg)
12749
12746
{
12750
12747
TrackAssignment<true >(pnode->AsParseNodeBin ()->pnode1 , nullptr );
12751
12748
}
@@ -13050,6 +13047,8 @@ ParseNodePtr Parser::ParseDestructuredVarDecl(tokens declarationType, bool isDec
13050
13047
Error (ERRInvalidAssignmentTarget);
13051
13048
}
13052
13049
13050
+ TrackAssignment<buildAST>(pnodeElem, &token);
13051
+
13053
13052
if (buildAST)
13054
13053
{
13055
13054
if (IsStrictMode () && pnodeElem != nullptr && pnodeElem->nop == knopName)
0 commit comments