File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
javascript/ql/lib/semmle/javascript Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -241,15 +241,23 @@ module API {
241241 }
242242
243243 /**
244- * Gets a node representing an instance of this API component, that is, an object whose
245- * constructor is the function represented by this node .
244+ * Gets a node representing an instance of the class represented by this node.
245+ * This includes instances of subclasses .
246246 *
247- * For example, if this node represents a use of some class `A`, then there might be a node
248- * representing instances of `A`, typically corresponding to expressions `new A()` at the
249- * source level.
247+ * For example:
248+ * ```js
249+ * import { C } from "foo";
250+ *
251+ * new C(); // API::moduleImport("foo").getMember("C").getInstance()
250252 *
251- * This predicate may have multiple results when there are multiple constructor calls invoking this API component.
252- * Consider using `getAnInstantiation()` if there is a need to distinguish between individual constructor calls.
253+ * class D extends C {
254+ * m() {
255+ * this; // API::moduleImport("foo").getMember("C").getInstance()
256+ * }
257+ * }
258+ *
259+ * new D(); // API::moduleImport("foo").getMember("C").getInstance()
260+ * ```
253261 */
254262 cached
255263 Node getInstance ( ) {
You can’t perform that action at this time.
0 commit comments