CodeQL library for JavaScript/TypeScript
codeql/javascript-all 0.8.13 (changelog, source)
Search

Predicate AccessPath::getAReferenceTo

Gets a node that refers to the given global access path.

This works for direct references as well as for aliases established through local data flow.

Examples:

function f() {
  let v = foo.bar; // reference to 'foo.bar'
  v.baz;           // reference to 'foo.bar.baz'
}

(function(ns) {
  ns.x;            // reference to 'NS.x'
})(NS = NS || {});

Import path

import javascript
Node getAReferenceTo(string path)