@mnemonica/tactica 0.1.12 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/analyzer.d.ts +39 -0
- package/lib/analyzer.js +214 -11
- package/lib/types.d.ts +6 -0
- package/lib/types.js +1 -1
- package/package.json +1 -1
package/lib/analyzer.d.ts
CHANGED
|
@@ -11,6 +11,10 @@ export declare class MnemonicaAnalyzer {
|
|
|
11
11
|
private usages;
|
|
12
12
|
private edsUsages;
|
|
13
13
|
private flowUsages;
|
|
14
|
+
private edsScopeByNode;
|
|
15
|
+
private functionBindings;
|
|
16
|
+
private nestedWrapVia;
|
|
17
|
+
private wrapEntryByNode;
|
|
14
18
|
private typeAliases;
|
|
15
19
|
private variableToTypeMap;
|
|
16
20
|
private moduleObjectVariables;
|
|
@@ -343,8 +347,43 @@ export declare class MnemonicaAnalyzer {
|
|
|
343
347
|
* Resolve type from EDS call argument (best effort)
|
|
344
348
|
*/
|
|
345
349
|
private resolveEDSArgumentType;
|
|
350
|
+
/**
|
|
351
|
+
* Resolve the enclosing mnemonica scope of an EDS call site by walking
|
|
352
|
+
* up the parent chain: nearest define()/lazy() call whose handler holds
|
|
353
|
+
* the node, or nearest @decorate()-ed class declaration. Best effort —
|
|
354
|
+
* returns undefined for calls outside any type scope (module top level).
|
|
355
|
+
*/
|
|
356
|
+
private resolveEDSScope;
|
|
357
|
+
/**
|
|
358
|
+
* Resolve a wrap() argument to its function node without the type
|
|
359
|
+
* checker: direct function expressions/arrows, or same-file bindings
|
|
360
|
+
* (`const fn = () => ...`, `function fn() ...`). Best effort — method
|
|
361
|
+
* references, .bind() products and cross-file identifiers stay
|
|
362
|
+
* unresolved; the callsite entry itself is still recorded.
|
|
363
|
+
*/
|
|
364
|
+
private resolveFunctionArgument;
|
|
365
|
+
/**
|
|
366
|
+
* Analyse a wrapped function's body for guaranteed runtime paths:
|
|
367
|
+
* dive wraps returned functions as well (recursively), so each
|
|
368
|
+
* function-valued return is a nested wrap site, and each `new Type()`
|
|
369
|
+
* inside the body means the path hits that type's constructor (which
|
|
370
|
+
* attachHooks wraps too). Both facts are 100% ensured, so they are
|
|
371
|
+
* recorded AoT. Nested function bodies are NOT walked here — they
|
|
372
|
+
* belong to their own wrap analysis, reached via the return chain.
|
|
373
|
+
* Depth-capped and cycle-guarded.
|
|
374
|
+
*/
|
|
375
|
+
private analyzeWrappedBody;
|
|
376
|
+
/**
|
|
377
|
+
* Record one function-valued return of a wrapped body as a nested wrap
|
|
378
|
+
* site (`via` = the site whose wrapping caused it) and recurse into
|
|
379
|
+
* its own returns. Returns through identifiers resolve through the
|
|
380
|
+
* same-file bindings table; unresolvable returns are simply skipped.
|
|
381
|
+
*/
|
|
382
|
+
private recordWrappedReturn;
|
|
346
383
|
/**
|
|
347
384
|
* Add an EDS usage to the collection
|
|
385
|
+
* Returns the stored entry (the existing one when this is a duplicate),
|
|
386
|
+
* so callers can enrich it after nested body analysis.
|
|
348
387
|
*/
|
|
349
388
|
private addEDS;
|
|
350
389
|
/**
|