monkeypatchlist 0.0.0-stage → 0.1.0
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/LICENSE +202 -0
- package/NOTICE +61 -0
- package/README.md +183 -2
- package/catalog/catalog.json +552211 -0
- package/catalog/catalog.schema.json +787 -0
- package/catalog/changelog.json +3 -0
- package/dist/bin/monkeypatchlist.d.ts +2 -0
- package/dist/bin/monkeypatchlist.js +3 -0
- package/dist/catalog.d.ts +561 -0
- package/dist/catalog.js +58 -0
- package/dist/cli.d.ts +84 -0
- package/dist/cli.js +470 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/lockfile-input.d.ts +9 -0
- package/dist/lockfile-input.js +91 -0
- package/dist/packages/analysis/binding.d.ts +2 -0
- package/dist/packages/analysis/binding.js +5 -0
- package/dist/packages/analysis/index.d.ts +10 -0
- package/dist/packages/analysis/index.js +13 -0
- package/dist/packages/analysis/job.d.ts +33 -0
- package/dist/packages/analysis/job.js +85 -0
- package/dist/packages/analysis/lib/absence-tags.d.ts +34 -0
- package/dist/packages/analysis/lib/absence-tags.js +340 -0
- package/dist/packages/analysis/lib/ast.d.ts +28 -0
- package/dist/packages/analysis/lib/ast.js +64 -0
- package/dist/packages/analysis/lib/binding.d.ts +36 -0
- package/dist/packages/analysis/lib/binding.js +66 -0
- package/dist/packages/analysis/lib/budget.d.ts +80 -0
- package/dist/packages/analysis/lib/budget.js +31 -0
- package/dist/packages/analysis/lib/catch-arms.d.ts +19 -0
- package/dist/packages/analysis/lib/catch-arms.js +351 -0
- package/dist/packages/analysis/lib/chunk-loads.d.ts +160 -0
- package/dist/packages/analysis/lib/chunk-loads.js +882 -0
- package/dist/packages/analysis/lib/chunk-registry.d.ts +45 -0
- package/dist/packages/analysis/lib/chunk-registry.js +334 -0
- package/dist/packages/analysis/lib/code-routes.d.ts +52 -0
- package/dist/packages/analysis/lib/code-routes.js +921 -0
- package/dist/packages/analysis/lib/collisions.d.ts +22 -0
- package/dist/packages/analysis/lib/collisions.js +103 -0
- package/dist/packages/analysis/lib/definitions.d.ts +76 -0
- package/dist/packages/analysis/lib/definitions.js +782 -0
- package/dist/packages/analysis/lib/early-exits.d.ts +39 -0
- package/dist/packages/analysis/lib/early-exits.js +161 -0
- package/dist/packages/analysis/lib/effect.d.ts +138 -0
- package/dist/packages/analysis/lib/effect.js +800 -0
- package/dist/packages/analysis/lib/global-object.d.ts +581 -0
- package/dist/packages/analysis/lib/global-object.js +8240 -0
- package/dist/packages/analysis/lib/keys.d.ts +33 -0
- package/dist/packages/analysis/lib/keys.js +82 -0
- package/dist/packages/analysis/lib/line-starts.d.ts +41 -0
- package/dist/packages/analysis/lib/line-starts.js +79 -0
- package/dist/packages/analysis/lib/link-group.d.ts +51 -0
- package/dist/packages/analysis/lib/link-group.js +487 -0
- package/dist/packages/analysis/lib/module-links.d.ts +117 -0
- package/dist/packages/analysis/lib/module-links.js +1060 -0
- package/dist/packages/analysis/lib/nested-code.d.ts +38 -0
- package/dist/packages/analysis/lib/nested-code.js +200 -0
- package/dist/packages/analysis/lib/numeric.d.ts +16 -0
- package/dist/packages/analysis/lib/numeric.js +216 -0
- package/dist/packages/analysis/lib/once-flags.d.ts +12 -0
- package/dist/packages/analysis/lib/once-flags.js +190 -0
- package/dist/packages/analysis/lib/parameter-arguments.d.ts +12 -0
- package/dist/packages/analysis/lib/parameter-arguments.js +34 -0
- package/dist/packages/analysis/lib/parse.d.ts +10 -0
- package/dist/packages/analysis/lib/parse.js +39 -0
- package/dist/packages/analysis/lib/partial.d.ts +60 -0
- package/dist/packages/analysis/lib/partial.js +518 -0
- package/dist/packages/analysis/lib/print.d.ts +3 -0
- package/dist/packages/analysis/lib/print.js +150 -0
- package/dist/packages/analysis/lib/reachability.d.ts +137 -0
- package/dist/packages/analysis/lib/reachability.js +1295 -0
- package/dist/packages/analysis/lib/resolver.d.ts +13 -0
- package/dist/packages/analysis/lib/resolver.js +2886 -0
- package/dist/packages/analysis/lib/restores.d.ts +42 -0
- package/dist/packages/analysis/lib/restores.js +482 -0
- package/dist/packages/analysis/lib/rewritten-deletes.d.ts +6 -0
- package/dist/packages/analysis/lib/rewritten-deletes.js +142 -0
- package/dist/packages/analysis/lib/scope.d.ts +110 -0
- package/dist/packages/analysis/lib/scope.js +443 -0
- package/dist/packages/analysis/lib/script-loads.d.ts +56 -0
- package/dist/packages/analysis/lib/script-loads.js +359 -0
- package/dist/packages/analysis/lib/summaries.d.ts +177 -0
- package/dist/packages/analysis/lib/summaries.js +498 -0
- package/dist/packages/analysis/lib/types.d.ts +632 -0
- package/dist/packages/analysis/lib/types.js +128 -0
- package/dist/packages/analysis/lib/wrap.d.ts +34 -0
- package/dist/packages/analysis/lib/wrap.js +407 -0
- package/dist/packages/analysis/lib/writes.d.ts +358 -0
- package/dist/packages/analysis/lib/writes.js +1612 -0
- package/dist/packages/analysis/visit-order.d.ts +3 -0
- package/dist/packages/analysis/visit-order.js +23 -0
- package/dist/packages/attribution/index.d.ts +233 -0
- package/dist/packages/attribution/index.js +444 -0
- package/dist/packages/attribution/lib/containing-package.d.ts +76 -0
- package/dist/packages/attribution/lib/containing-package.js +304 -0
- package/dist/packages/attribution/lib/first-party.d.ts +37 -0
- package/dist/packages/attribution/lib/first-party.js +153 -0
- package/dist/packages/attribution/lib/lockfile-graph.d.ts +99 -0
- package/dist/packages/attribution/lib/lockfile-graph.js +158 -0
- package/dist/packages/attribution/lib/lockfile.d.ts +33 -0
- package/dist/packages/attribution/lib/lockfile.js +330 -0
- package/dist/packages/attribution/lib/path-rules.d.ts +29 -0
- package/dist/packages/attribution/lib/path-rules.js +84 -0
- package/dist/packages/attribution/lib/pnpm.d.ts +4 -0
- package/dist/packages/attribution/lib/pnpm.js +133 -0
- package/dist/packages/attribution/lib/remote-url.d.ts +7 -0
- package/dist/packages/attribution/lib/remote-url.js +24 -0
- package/dist/packages/attribution/lib/source-map.d.ts +51 -0
- package/dist/packages/attribution/lib/source-map.js +125 -0
- package/dist/packages/attribution/lib/yaml.d.ts +9 -0
- package/dist/packages/attribution/lib/yaml.js +277 -0
- package/dist/packages/attribution/lib/yarn.d.ts +7 -0
- package/dist/packages/attribution/lib/yarn.js +227 -0
- package/dist/packages/baseline/index.d.ts +45 -0
- package/dist/packages/baseline/index.js +41 -0
- package/dist/packages/baseline/lib/error.d.ts +15 -0
- package/dist/packages/baseline/lib/error.js +25 -0
- package/dist/packages/baseline/lib/format.d.ts +49 -0
- package/dist/packages/baseline/lib/format.js +22 -0
- package/dist/packages/baseline/lib/migrations.d.ts +19 -0
- package/dist/packages/baseline/lib/migrations.js +7 -0
- package/dist/packages/baseline/lib/previous.d.ts +23 -0
- package/dist/packages/baseline/lib/previous.js +64 -0
- package/dist/packages/baseline/lib/read.d.ts +39 -0
- package/dist/packages/baseline/lib/read.js +219 -0
- package/dist/packages/baseline/lib/report.d.ts +25 -0
- package/dist/packages/baseline/lib/report.js +104 -0
- package/dist/packages/baseline/lib/skew.d.ts +51 -0
- package/dist/packages/baseline/lib/skew.js +75 -0
- package/dist/packages/compare/index.d.ts +120 -0
- package/dist/packages/compare/index.js +274 -0
- package/dist/packages/compare/lib/catalog-notes.d.ts +73 -0
- package/dist/packages/compare/lib/catalog-notes.js +224 -0
- package/dist/packages/completeness/index.d.ts +246 -0
- package/dist/packages/completeness/index.js +249 -0
- package/dist/packages/confidence/index.d.ts +54 -0
- package/dist/packages/confidence/index.js +71 -0
- package/dist/packages/config/index.d.ts +107 -0
- package/dist/packages/config/index.js +95 -0
- package/dist/packages/config/lib/command-line.d.ts +23 -0
- package/dist/packages/config/lib/command-line.js +239 -0
- package/dist/packages/config/lib/config-file.d.ts +11 -0
- package/dist/packages/config/lib/config-file.js +119 -0
- package/dist/packages/config/lib/scan-config-id.d.ts +28 -0
- package/dist/packages/config/lib/scan-config-id.js +54 -0
- package/dist/packages/config/lib/schema.d.ts +2 -0
- package/dist/packages/config/lib/schema.js +31 -0
- package/dist/packages/config/lib/types.d.ts +64 -0
- package/dist/packages/config/lib/types.js +6 -0
- package/dist/packages/config/lib/urls.d.ts +6 -0
- package/dist/packages/config/lib/urls.js +9 -0
- package/dist/packages/discovery/index.d.ts +277 -0
- package/dist/packages/discovery/index.js +1950 -0
- package/dist/packages/discovery/lib/import-map.d.ts +68 -0
- package/dist/packages/discovery/lib/import-map.js +180 -0
- package/dist/packages/discovery/lib/requests.d.ts +58 -0
- package/dist/packages/discovery/lib/requests.js +591 -0
- package/dist/packages/discovery/lib/scopes.d.ts +6 -0
- package/dist/packages/discovery/lib/scopes.js +286 -0
- package/dist/packages/discovery/lib/source-maps.d.ts +56 -0
- package/dist/packages/discovery/lib/source-maps.js +209 -0
- package/dist/packages/discovery/lib/swept-code.d.ts +27 -0
- package/dist/packages/discovery/lib/swept-code.js +107 -0
- package/dist/packages/discovery/lib/syntax.d.ts +17 -0
- package/dist/packages/discovery/lib/syntax.js +39 -0
- package/dist/packages/findings/index.d.ts +106 -0
- package/dist/packages/findings/index.js +254 -0
- package/dist/packages/findings/lib/scope.d.ts +38 -0
- package/dist/packages/findings/lib/scope.js +110 -0
- package/dist/packages/parallel/index.d.ts +2 -0
- package/dist/packages/parallel/index.js +5 -0
- package/dist/packages/parallel/lib/protocol.d.ts +15 -0
- package/dist/packages/parallel/lib/protocol.js +2 -0
- package/dist/packages/parallel/lib/runner.d.ts +36 -0
- package/dist/packages/parallel/lib/runner.js +96 -0
- package/dist/packages/parallel/lib/schedule.d.ts +16 -0
- package/dist/packages/parallel/lib/schedule.js +52 -0
- package/dist/packages/parallel/lib/worker.d.ts +1 -0
- package/dist/packages/parallel/lib/worker.js +18 -0
- package/dist/packages/policy/index.d.ts +36 -0
- package/dist/packages/policy/index.js +22 -0
- package/dist/packages/report/explain.d.ts +26 -0
- package/dist/packages/report/explain.js +99 -0
- package/dist/packages/report/index.d.ts +210 -0
- package/dist/packages/report/index.js +388 -0
- package/dist/packages/report/terminal.d.ts +11 -0
- package/dist/packages/report/terminal.js +331 -0
- package/dist/packages/source-store/fixture.d.ts +22 -0
- package/dist/packages/source-store/fixture.js +58 -0
- package/dist/packages/source-store/index.d.ts +278 -0
- package/dist/packages/source-store/index.js +322 -0
- package/dist/packages/source-store/lib/addresses.d.ts +6 -0
- package/dist/packages/source-store/lib/addresses.js +91 -0
- package/dist/packages/source-store/lib/connection.d.ts +15 -0
- package/dist/packages/source-store/lib/connection.js +135 -0
- package/dist/packages/source-store/lib/content-types.d.ts +16 -0
- package/dist/packages/source-store/lib/content-types.js +75 -0
- package/dist/packages/source-store/lib/data-urls.d.ts +10 -0
- package/dist/packages/source-store/lib/data-urls.js +85 -0
- package/dist/packages/source-store/lib/deadline.d.ts +18 -0
- package/dist/packages/source-store/lib/deadline.js +44 -0
- package/dist/packages/source-store/lib/exchange.d.ts +29 -0
- package/dist/packages/source-store/lib/exchange.js +112 -0
- package/dist/packages/source-store/lib/integrity.d.ts +19 -0
- package/dist/packages/source-store/lib/integrity.js +86 -0
- package/dist/packages/source-store/lib/outcomes.d.ts +12 -0
- package/dist/packages/source-store/lib/outcomes.js +22 -0
- package/dist/packages/source-store/lib/proxy.d.ts +11 -0
- package/dist/packages/source-store/lib/proxy.js +53 -0
- package/dist/packages/source-store/lib/session.d.ts +12 -0
- package/dist/packages/source-store/lib/session.js +139 -0
- package/dist/packages/source-store/lib/urls.d.ts +6 -0
- package/dist/packages/source-store/lib/urls.js +15 -0
- package/dist/packages/source-store/resolve.d.ts +59 -0
- package/dist/packages/source-store/resolve.js +45 -0
- package/dist/scan.d.ts +65 -0
- package/dist/scan.js +592 -0
- package/package.json +95 -4
- package/schema/config.schema.json +133 -0
- package/schema/report.schema.json +1905 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AstNode } from './ast.ts';
|
|
2
|
+
import type { Definitions } from './definitions.ts';
|
|
3
|
+
import type { Position } from './global-object.ts';
|
|
4
|
+
/**
|
|
5
|
+
* The arguments a parameter `id` takes, each where its call evaluates it, when `id` reads a plain parameter of a function
|
|
6
|
+
* that a frame of `at` instantiates from listed calls, and nothing in the function reassigns it. Undefined otherwise: a
|
|
7
|
+
* function judged from its creation site, a destructured or reassigned parameter, a spread or unlisted argument.
|
|
8
|
+
*/
|
|
9
|
+
export declare function parameterArguments(definitions: Definitions, id: AstNode, at: Position): {
|
|
10
|
+
node: AstNode;
|
|
11
|
+
at: Position;
|
|
12
|
+
}[] | undefined;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// The arguments a helper's parameter takes (§5 Resolver capabilities 3): a parameter of a function instantiated from
|
|
2
|
+
// listed calls holds what each call passes, evaluated where the call is. Wrap evidence and restore proofs (§3)
|
|
3
|
+
// read them where the values alone can't say what they need: that a value is a factory's result given the original, or
|
|
4
|
+
// the slot a constructor was read from.
|
|
5
|
+
/**
|
|
6
|
+
* The arguments a parameter `id` takes, each where its call evaluates it, when `id` reads a plain parameter of a function
|
|
7
|
+
* that a frame of `at` instantiates from listed calls, and nothing in the function reassigns it. Undefined otherwise: a
|
|
8
|
+
* function judged from its creation site, a destructured or reassigned parameter, a spread or unlisted argument.
|
|
9
|
+
*/
|
|
10
|
+
export function parameterArguments(definitions, id, at) {
|
|
11
|
+
const key = definitions.keyOf(id);
|
|
12
|
+
if (key === undefined || key.scope === 'global')
|
|
13
|
+
return undefined;
|
|
14
|
+
const fn = key.scope;
|
|
15
|
+
const index = (fn['params'] ?? []).findIndex((param) => param.type === 'Identifier' && param['name'] === key.name);
|
|
16
|
+
if (index < 0 || definitions.of(key).length > 0)
|
|
17
|
+
return undefined;
|
|
18
|
+
let frame = at.frame;
|
|
19
|
+
while (frame !== undefined && frame.fn !== fn)
|
|
20
|
+
frame = frame.outer;
|
|
21
|
+
if (frame === undefined || frame.how === 'creation' || frame.bindings.length === 0)
|
|
22
|
+
return undefined;
|
|
23
|
+
const found = [];
|
|
24
|
+
for (const { site, caller, element } of frame.bindings) {
|
|
25
|
+
// An iteration native's callback is passed the element it visits, which no argument expression gives.
|
|
26
|
+
const argument = element === undefined ? site.args[index] : undefined;
|
|
27
|
+
if (argument === undefined || argument.type === 'SpreadElement')
|
|
28
|
+
return undefined;
|
|
29
|
+
if (site.unlisted !== undefined && index >= site.unlisted)
|
|
30
|
+
return undefined;
|
|
31
|
+
found.push({ node: argument, at: { guard: (name) => site.guards.get(name), topLevel: site.topLevel, frame: caller } });
|
|
32
|
+
}
|
|
33
|
+
return found;
|
|
34
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AstNode } from './ast.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Parses code with `oxc-parser`: its program, or the first error. A partially recovered AST is never returned (§13). A
|
|
4
|
+
* script with an `import` or `export` declaration doesn't parse, as in a browser.
|
|
5
|
+
*/
|
|
6
|
+
export declare function parse(text: string, sourceType: 'script' | 'module'): {
|
|
7
|
+
program: AstNode;
|
|
8
|
+
} | {
|
|
9
|
+
error: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { parseSync, rawTransferSupported } from 'oxc-parser';
|
|
2
|
+
/** Raw transfer where the platform supports it (§5 Parsing and scope). The option is not in oxc's typings. */
|
|
3
|
+
const rawTransfer = rawTransferSupported();
|
|
4
|
+
/** The parser options §5 fixes, with the `sourceType` always explicit. */
|
|
5
|
+
const parserOptions = (sourceType) => ({
|
|
6
|
+
lang: 'js',
|
|
7
|
+
sourceType,
|
|
8
|
+
range: true,
|
|
9
|
+
preserveParens: false,
|
|
10
|
+
experimentalRawTransfer: rawTransfer,
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* The early error for an `import` or `export` declaration in a script, by declaration type. The ECMAScript Script goal
|
|
14
|
+
* has no such declarations, but oxc reports them only among its semantic errors, which §5's options leave out.
|
|
15
|
+
*/
|
|
16
|
+
const moduleDeclarations = new Map([
|
|
17
|
+
['ImportDeclaration', 'Cannot use import statement outside a module'],
|
|
18
|
+
['ExportNamedDeclaration', 'Cannot use export statement outside a module'],
|
|
19
|
+
['ExportDefaultDeclaration', 'Cannot use export statement outside a module'],
|
|
20
|
+
['ExportAllDeclaration', 'Cannot use export statement outside a module'],
|
|
21
|
+
]);
|
|
22
|
+
/**
|
|
23
|
+
* Parses code with `oxc-parser`: its program, or the first error. A partially recovered AST is never returned (§13). A
|
|
24
|
+
* script with an `import` or `export` declaration doesn't parse, as in a browser.
|
|
25
|
+
*/
|
|
26
|
+
export function parse(text, sourceType) {
|
|
27
|
+
const parsed = parseSync('artifact.js', text, parserOptions(sourceType));
|
|
28
|
+
const [error] = parsed.errors;
|
|
29
|
+
if (error !== undefined)
|
|
30
|
+
return { error: error.message };
|
|
31
|
+
const program = parsed.program;
|
|
32
|
+
if (sourceType === 'script') {
|
|
33
|
+
// Import and export declarations can only be top-level statements, so the program's body holds any there are.
|
|
34
|
+
const declaration = program['body'].find(({ type }) => moduleDeclarations.has(type));
|
|
35
|
+
if (declaration !== undefined)
|
|
36
|
+
return { error: moduleDeclarations.get(declaration.type) };
|
|
37
|
+
}
|
|
38
|
+
return { program };
|
|
39
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type AstNode } from './ast.ts';
|
|
2
|
+
import type { Definitions, VariableKey } from './definitions.ts';
|
|
3
|
+
import { type Key as MemberKey } from './keys.ts';
|
|
4
|
+
import type { OpenWrite, WildWrite } from './writes.ts';
|
|
5
|
+
export interface ShapeContext {
|
|
6
|
+
program: AstNode;
|
|
7
|
+
definitions: Definitions;
|
|
8
|
+
/** The constant key an expression folds to, as ToPropertyKey converts it, or none when it doesn't fold to one. */
|
|
9
|
+
fold(key: AstNode): MemberKey | undefined;
|
|
10
|
+
/** Whether a callee is a catalog native: a native function, a native holder, or a catalog member read from one. */
|
|
11
|
+
isCatalogNative(callee: AstNode): boolean;
|
|
12
|
+
/** Whether a callee is `Object.getOwnPropertyDescriptor` or `Reflect.getOwnPropertyDescriptor`. */
|
|
13
|
+
isDescriptorReader(callee: AstNode): boolean;
|
|
14
|
+
/** How deep an alias chain is followed to its root (§18, `Caps.aliasDepth`). */
|
|
15
|
+
aliasDepth: number;
|
|
16
|
+
/** Counts a hit of the `aliasDepth` cap at the alias it keeps from being followed (§18). */
|
|
17
|
+
aliasCut(id: AstNode): void;
|
|
18
|
+
/** The functions the program makes that a callee can be, for reads made in a summarized callee. */
|
|
19
|
+
calleeFunctions(callee: AstNode): AstNode[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* How a wildcard write reuses its key (§5 Partially resolved writes): the reads of the same (holder, key) before
|
|
23
|
+
* it, which give the original, and whether the write keeps the member when present, which makes its value equal the
|
|
24
|
+
* read then.
|
|
25
|
+
*/
|
|
26
|
+
export interface Reuse {
|
|
27
|
+
/** Whether a node gives the original: a read of the slot, a summarized call that reads it, or a fetched descriptor's `value`. */
|
|
28
|
+
isOriginal(node: AstNode): boolean;
|
|
29
|
+
/** Whether the write keeps the member when present: `o[k] || p`, `o[k] ||= p`, `if (!o[k])`, `if (!(k in o))`. */
|
|
30
|
+
keptWhenPresent: boolean;
|
|
31
|
+
/** Whether the value written is a read of the same slot, which writes back what is there. */
|
|
32
|
+
writesBack: boolean;
|
|
33
|
+
}
|
|
34
|
+
/** Patch-shape and key-reuse judgements over one program (§5 Partially resolved writes). */
|
|
35
|
+
export interface Shapes {
|
|
36
|
+
/** Whether a write site whose holder doesn't resolve keeps the original of its slot. */
|
|
37
|
+
patchShaped(write: OpenWrite): boolean;
|
|
38
|
+
/** How a wildcard write reuses its key, or undefined when it doesn't: no read of it, nor its descriptor, comes first. */
|
|
39
|
+
reuse(write: WildWrite): Reuse | undefined;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Holder signatures over one program (§5 Partially resolved writes): the same for two expressions that give the same
|
|
43
|
+
* holder, the same root variable, parameter or `this` through the same constant property chain after aliases.
|
|
44
|
+
*/
|
|
45
|
+
export interface Slots {
|
|
46
|
+
/** A holder expression's signature, with the variables it reads in `roots`; none when it is no such expression. */
|
|
47
|
+
signature(expression: AstNode, roots: VariableKey[]): string | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* A key expression's signature, with the variables it reads in `roots`, read from the syntax alone, with nothing
|
|
50
|
+
* evaluated: the same for two expressions that give the same key, a literal, or the same variable, parameter or
|
|
51
|
+
* `this` through the same property chain, whose computed keys are such expressions too (`names[i]`); none for
|
|
52
|
+
* anything else.
|
|
53
|
+
*/
|
|
54
|
+
keySignature(expression: AstNode, roots: VariableKey[]): string | undefined;
|
|
55
|
+
/** Whether a root variable is defined again between `from` and `to`. */
|
|
56
|
+
redefined(roots: readonly VariableKey[], from: number, to: number): boolean;
|
|
57
|
+
}
|
|
58
|
+
export declare function slotSignatures(context: Pick<ShapeContext, 'definitions' | 'fold' | 'aliasDepth' | 'aliasCut'>): Slots;
|
|
59
|
+
/** Patch-shape and key-reuse judgements over one program: its parents, computed once. */
|
|
60
|
+
export declare function patchShapes(context: ShapeContext): Shapes;
|