CodeQL library for JavaScript

Predicate AccessPath::getAnAssignmentTo

Gets a node that is assigned to the given global access path.

Only gets the immediate right-hand side of an assignment or property or a global declaration, not nodes that transitively flow there.

For example, the class nodes below are all assignments to = class {};
foo = { bar: class {} };
(function(f) { = class {}
 })(foo = foo || {});

Import path

import javascript
Node getAnAssignmentTo(string path)