File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
javascript/ql/lib/semmle/javascript/internal Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -271,6 +271,32 @@ module NameResolution {
271
271
*/
272
272
module TypeFlow = FlowImpl< TypeConfig > ;
273
273
274
+ /**
275
+ * Generates a directed graph for tracking type names or value names back toward their definition.
276
+ * The ultimate definition might not be in the database, but the graph lets us track as far as we can.
277
+ *
278
+ * The module parameter determines whether types or values should be tracked.
279
+ *
280
+ * The example below illustrates the need for two separate instantiations of this module.
281
+ * When tracking through the nodes corresponding to `X`, we need to remember whether a type or value was tracked.
282
+ *
283
+ * ```ts
284
+ * // lib.ts
285
+ * class C1 {}
286
+ * class C2 {}
287
+ *
288
+ * const X = C1;
289
+ * type X = C2;
290
+ *
291
+ * export { X }
292
+ *
293
+ * // use.ts
294
+ * import { X } from "./lib"
295
+ *
296
+ * var x1 = X // should refer to C1
297
+ * var x2: X; // should refer to C2
298
+ * ```
299
+ */
274
300
private module FlowImpl< TypeResolutionInputSig S> {
275
301
/**
276
302
* Gets the exported member of `mod` named `name`.
You can’t perform that action at this time.
0 commit comments