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

Member predicate API::Node::getInstance

Gets a node representing an instance of the class represented by this node. This includes instances of subclasses.

For example:

import { C } from "foo";

new C(); // API::moduleImport("foo").getMember("C").getInstance()

class D extends C {
  m() {
    this; // API::moduleImport("foo").getMember("C").getInstance()
 }
}

new D(); // API::moduleImport("foo").getMember("C").getInstance()
Node getInstance()