Problem
extractFuncPropMethodsWalk registers fn.method as a method definition, but extractSpreadForOfWalk's funcStack has no branch for the assignment_expression case (fn.method = function(){}).
When walking into that function_expression body, funcStack is empty (or holds the outer function), so any for-of loop inside emits a forOfBinding with enclosingFunc = '<module>' (or the wrong outer name). buildPointsToMap seeds pts['<module>::x'], but build-edges.ts only checks modulePtsKey when caller.callerName === null; for a call inside fn.method the callerName is 'fn.method', so the PTS key never matches and the for-of callback edges are silently dropped.
Repro
const callbacks = [doA, doB];
const obj = {};
obj.run = function() {
for (const cb of callbacks) cb(); // cb() edge silently dropped
};
Fix
Add an else if (node.type === 'assignment_expression') branch in extractSpreadForOfWalk that extracts the method name from a member-expression LHS (mirroring handleFuncPropAssignment's logic) and pushes it onto funcStack.
Context
Identified in Greptile review of PR #1331.
Problem
extractFuncPropMethodsWalkregistersfn.methodas a method definition, butextractSpreadForOfWalk'sfuncStackhas no branch for theassignment_expressioncase (fn.method = function(){}).When walking into that
function_expressionbody,funcStackis empty (or holds the outer function), so anyfor-ofloop inside emits aforOfBindingwithenclosingFunc = '<module>'(or the wrong outer name).buildPointsToMapseedspts['<module>::x'], butbuild-edges.tsonly checksmodulePtsKeywhencaller.callerName === null; for a call insidefn.methodthecallerNameis'fn.method', so the PTS key never matches and the for-of callback edges are silently dropped.Repro
Fix
Add an
else if (node.type === 'assignment_expression')branch inextractSpreadForOfWalkthat extracts the method name from a member-expression LHS (mirroringhandleFuncPropAssignment's logic) and pushes it ontofuncStack.Context
Identified in Greptile review of PR #1331.