You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JS: parameters of a this.x = function member are not shadowed, so passing one as an argument fabricates an indirect_call to any same-named function in the corpus #5241
Related:#4448 and #5217 (both fixed). This is a third case in the same family that the #5221 fix does not cover.
Summary
A parameter of a function assigned to this.x inside a callback (the AngularJS service shape) is not shadowed. When the parameter is passed as a call argument, it resolves corpus-wide and binds to any function with the same name, even a non-exported function in a TypeScript file that nothing imports. The same function assigned to $scope.x instead of this.x is shadowed correctly.
Reproduction
app/service.js:
angular.module('app').service('$svc',function($http){varsvc=this;// D: this.member param, passed to a bare callthis.d=function(scope){bare(scope);};// E: this.member param, passed to a member callthis.e=function(scope,group){this.defaults(scope,group);};// F: this.member param, passed to a call on a captured aliasthis.f=function(item){returnsvc.selectable(item);};});angular.module('app').controller('Ctrl',function($scope){// control: the same shape on a $scope member is shadowed$scope.g=function(scope){bare(scope);};});
web/helpers.ts (not exported, not imported anywhere):
The control case $scope.g gives no edge. The kind of call does not matter (bare, this.method() or a call on a captured alias). What matters is that the function is a this.x member, which is the form extracted as a node since #3408 (labelled d(), e(), f() here). It looks like the parameter scope of that node is not seeded before its body is resolved.
Impact
In a real codebase that mixes an AngularJS frontend with a separate TypeScript app, 21 cross-layer indirect_call edges remain after 0.9.110 (down from 55, thanks to #5221). Most of them sit in this.x members of AngularJS services and go to functions with generic names such as scope(), item() and value(). A few come from nearby forms that may share the cause: a parameter used as an object-literal value ({ comment: comment }) and a function assigned to a member of a local object (api.safeText = function (value) {...}).
Suggested direction
When a this.x = function (...) {} assignment becomes a member node, register its parameters as locals of that node, the same as for a function declaration or a $scope.x assignment, before its call arguments are resolved.
Activity
github-actions commentedon Nov 16, 2026
Thanks for opening this issue, @laurism-openelms. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.
chore: combined AST cache schema bump to 48 and scope-honest guard test
fix(js): shadow params of a this.x = function member (Graphify-Labs#5241