@nudojs/core 1.9.1 → 1.9.3
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/dist/{chunk-733OATC3.js → chunk-HD6XZFOU.js} +165 -15
- package/dist/{chunk-3BRXCIVZ.js → chunk-VMGJYMIF.js} +39 -14
- package/dist/exec.d.ts +16 -6
- package/dist/exec.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +8 -4
- package/dist/internal.d.ts +9 -4
- package/dist/internal.js +8 -4
- package/dist/{projection-budget-Bb8CYJOR.d.ts → projection-budget-Dm1YWZ1U.d.ts} +16 -4
- package/dist/{run-2B7ohsfP.d.ts → run-WZKUu1y1.d.ts} +1 -1
- package/package.json +1 -1
|
@@ -6087,9 +6087,17 @@ var memberGuardTarget = (n) => {
|
|
|
6087
6087
|
const t = n;
|
|
6088
6088
|
const m = t?.type === "ChainExpression" ? t.expression : t;
|
|
6089
6089
|
if (m?.type !== "MemberExpression" && m?.type !== "OptionalMemberExpression") return void 0;
|
|
6090
|
-
if (m.computed) return void 0;
|
|
6091
6090
|
if (m.object?.type !== "Identifier" || !m.object.name) return void 0;
|
|
6092
6091
|
const p = m.property;
|
|
6092
|
+
if (m.computed) {
|
|
6093
|
+
if (p?.type === "NumericLiteral" && typeof p.value === "number") {
|
|
6094
|
+
return { name: m.object.name, key: String(p.value) };
|
|
6095
|
+
}
|
|
6096
|
+
if (p?.type === "StringLiteral" && typeof p.value === "string" && /^-?\d+$/.test(p.value)) {
|
|
6097
|
+
return { name: m.object.name, key: p.value };
|
|
6098
|
+
}
|
|
6099
|
+
return void 0;
|
|
6100
|
+
}
|
|
6093
6101
|
const key = p?.type === "Identifier" ? p.name : p?.type === "StringLiteral" && typeof p.value === "string" ? p.value : void 0;
|
|
6094
6102
|
if (key === void 0) return void 0;
|
|
6095
6103
|
return { name: m.object.name, key };
|
|
@@ -6196,19 +6204,89 @@ function mergeGuardInto(list, g) {
|
|
|
6196
6204
|
if (grainA !== grainB) prev.grain = "nullish";
|
|
6197
6205
|
if (prev.memberKey === void 0 && g.memberKey !== void 0) prev.memberKey = g.memberKey;
|
|
6198
6206
|
}
|
|
6207
|
+
var methodReceiverTarget = (callee) => {
|
|
6208
|
+
const c = callee;
|
|
6209
|
+
if (c?.type !== "MemberExpression") return void 0;
|
|
6210
|
+
const o = c.object;
|
|
6211
|
+
if (o?.type === "Identifier" && o.name) return { name: o.name };
|
|
6212
|
+
if (o?.type === "MemberExpression") return memberGuardTarget(o);
|
|
6213
|
+
return void 0;
|
|
6214
|
+
};
|
|
6215
|
+
var collectReceiverFacts = (n, ctx2, out) => {
|
|
6216
|
+
if (ctx2 === null || !n || typeof n !== "object") return;
|
|
6217
|
+
const t = n;
|
|
6218
|
+
switch (t.type) {
|
|
6219
|
+
case "LogicalExpression":
|
|
6220
|
+
if (t.operator === "&&" || t.operator === "||") {
|
|
6221
|
+
const rArm = t.operator === "&&" ? "cons" : "alt";
|
|
6222
|
+
collectReceiverFacts(t.left, ctx2, out);
|
|
6223
|
+
collectReceiverFacts(
|
|
6224
|
+
t.right,
|
|
6225
|
+
ctx2 === "both" || ctx2 === rArm ? rArm : null,
|
|
6226
|
+
out
|
|
6227
|
+
);
|
|
6228
|
+
} else if (t.operator === "??") {
|
|
6229
|
+
collectReceiverFacts(t.left, ctx2, out);
|
|
6230
|
+
}
|
|
6231
|
+
return;
|
|
6232
|
+
case "ConditionalExpression":
|
|
6233
|
+
collectReceiverFacts(t.test, ctx2, out);
|
|
6234
|
+
return;
|
|
6235
|
+
case "CallExpression": {
|
|
6236
|
+
const recv = methodReceiverTarget(t.callee);
|
|
6237
|
+
if (recv) {
|
|
6238
|
+
for (const arm of ctx2 === "both" ? ["cons", "alt"] : [ctx2]) {
|
|
6239
|
+
out.push({
|
|
6240
|
+
name: recv.name,
|
|
6241
|
+
arm,
|
|
6242
|
+
grain: "nullish",
|
|
6243
|
+
...recv.key !== void 0 ? { memberKey: recv.key } : {}
|
|
6244
|
+
});
|
|
6245
|
+
}
|
|
6246
|
+
}
|
|
6247
|
+
collectReceiverFacts(t.callee, ctx2, out);
|
|
6248
|
+
for (const a of t.arguments ?? []) collectReceiverFacts(a, ctx2, out);
|
|
6249
|
+
return;
|
|
6250
|
+
}
|
|
6251
|
+
default:
|
|
6252
|
+
collectReceiverFacts(t.left, ctx2, out);
|
|
6253
|
+
collectReceiverFacts(t.right, ctx2, out);
|
|
6254
|
+
collectReceiverFacts(t.argument, ctx2, out);
|
|
6255
|
+
collectReceiverFacts(t.object, ctx2, out);
|
|
6256
|
+
if (t.computed) collectReceiverFacts(t.property, ctx2, out);
|
|
6257
|
+
return;
|
|
6258
|
+
}
|
|
6259
|
+
};
|
|
6260
|
+
function appendReceiverGuards(test, out) {
|
|
6261
|
+
const facts = [];
|
|
6262
|
+
collectReceiverFacts(test, "both", facts);
|
|
6263
|
+
for (const f of facts) {
|
|
6264
|
+
const prev = out.find((x) => x.name === f.name && x.arm === f.arm);
|
|
6265
|
+
if (!prev) {
|
|
6266
|
+
out.push(f);
|
|
6267
|
+
continue;
|
|
6268
|
+
}
|
|
6269
|
+
const grainA = prev.grain ?? "nullish";
|
|
6270
|
+
const grainB = f.grain ?? "nullish";
|
|
6271
|
+
if (grainA !== grainB) prev.grain = "nullish";
|
|
6272
|
+
if (prev.memberKey === void 0 && f.memberKey !== void 0) prev.memberKey = f.memberKey;
|
|
6273
|
+
}
|
|
6274
|
+
}
|
|
6199
6275
|
function nullishGuardsOf(test) {
|
|
6200
6276
|
const t = test;
|
|
6201
6277
|
if (t?.type === "LogicalExpression" && (t.operator === "||" || t.operator === "&&")) {
|
|
6202
6278
|
const wantArm = t.operator === "||" ? "alt" : "cons";
|
|
6203
|
-
const
|
|
6279
|
+
const out2 = [];
|
|
6204
6280
|
for (const g2 of [...nullishGuardsOf(t.left), ...nullishGuardsOf(t.right)]) {
|
|
6205
6281
|
if (g2.arm !== wantArm) continue;
|
|
6206
|
-
mergeGuardInto(
|
|
6282
|
+
mergeGuardInto(out2, g2);
|
|
6207
6283
|
}
|
|
6208
|
-
return
|
|
6284
|
+
return out2;
|
|
6209
6285
|
}
|
|
6210
6286
|
const g = nullishGuardOf(test);
|
|
6211
|
-
|
|
6287
|
+
const out = g ? [g] : [];
|
|
6288
|
+
appendReceiverGuards(test, out);
|
|
6289
|
+
return out;
|
|
6212
6290
|
}
|
|
6213
6291
|
function typeGuardOf(test) {
|
|
6214
6292
|
const t = test;
|
|
@@ -15421,25 +15499,75 @@ function $removeUndefined(a) {
|
|
|
15421
15499
|
}
|
|
15422
15500
|
function $removeMemberNullish(a, key) {
|
|
15423
15501
|
if (!a || typeof a !== "object" || !("shape" in a)) return a;
|
|
15502
|
+
if (a.shape.k === "sum") {
|
|
15503
|
+
const members = a.shape.members;
|
|
15504
|
+
const kept = [];
|
|
15505
|
+
let changed = false;
|
|
15506
|
+
for (const m of members) {
|
|
15507
|
+
const r2 = memberSlotTruthyRefine(m, key);
|
|
15508
|
+
if (r2.kind === "prune") {
|
|
15509
|
+
changed = true;
|
|
15510
|
+
continue;
|
|
15511
|
+
}
|
|
15512
|
+
if (r2.kind === "keep") {
|
|
15513
|
+
kept.push(m);
|
|
15514
|
+
continue;
|
|
15515
|
+
}
|
|
15516
|
+
changed = true;
|
|
15517
|
+
const sh = m.shape;
|
|
15518
|
+
const next2 = { ...m, shape: { ...sh, slots: { ...sh.slots, [key]: r2.slot } } };
|
|
15519
|
+
migrateAccessors(m, next2);
|
|
15520
|
+
migrateInvariants(m, next2);
|
|
15521
|
+
migrateNullProto(m, next2);
|
|
15522
|
+
kept.push(next2);
|
|
15523
|
+
}
|
|
15524
|
+
if (!changed || kept.length === 0) return a;
|
|
15525
|
+
return kept.length === 1 ? kept[0] : { ...a, shape: { k: "sum", members: kept } };
|
|
15526
|
+
}
|
|
15424
15527
|
if (a.shape.k !== "obj") return a;
|
|
15425
15528
|
const slots = a.shape.slots;
|
|
15426
15529
|
if (!Object.prototype.hasOwnProperty.call(slots, key)) return a;
|
|
15530
|
+
const r = memberSlotTruthyRefine(a, key);
|
|
15531
|
+
if (r.kind !== "refine") return a;
|
|
15532
|
+
const next = { ...a, shape: { ...a.shape, slots: { ...slots, [key]: r.slot } } };
|
|
15533
|
+
migrateAccessors(a, next);
|
|
15534
|
+
migrateInvariants(a, next);
|
|
15535
|
+
migrateNullProto(a, next);
|
|
15536
|
+
return next;
|
|
15537
|
+
}
|
|
15538
|
+
function definitelyNullishAbs(a) {
|
|
15539
|
+
if (isNullishLitAbs(a)) return true;
|
|
15540
|
+
if (a.shape.k === "sum") {
|
|
15541
|
+
const members = a.shape.members;
|
|
15542
|
+
return members.length > 0 && members.every((m) => isNullishLitAbs(m));
|
|
15543
|
+
}
|
|
15544
|
+
return false;
|
|
15545
|
+
}
|
|
15546
|
+
function memberSlotTruthyRefine(m, key) {
|
|
15547
|
+
if (m.shape.k !== "obj") return { kind: "keep" };
|
|
15548
|
+
const slots = m.shape.slots;
|
|
15549
|
+
if (!Object.prototype.hasOwnProperty.call(slots, key)) {
|
|
15550
|
+
const sh = m.shape;
|
|
15551
|
+
if (sh.open || sh.index) return { kind: "keep" };
|
|
15552
|
+
if (OBJECT_PROTO_METHOD_NAMES2.has(key) || key === "constructor") return { kind: "keep" };
|
|
15553
|
+
if (accessorTable.get(m)?.has(key)) return { kind: "keep" };
|
|
15554
|
+
return { kind: "prune" };
|
|
15555
|
+
}
|
|
15556
|
+
if (accessorTable.get(m)?.get(key)?.get) return { kind: "keep" };
|
|
15427
15557
|
const slot = slots[key];
|
|
15558
|
+
if (definitelyNullishAbs(slot.value)) return { kind: "prune" };
|
|
15428
15559
|
let value = slot.value;
|
|
15429
|
-
let changed = false;
|
|
15430
15560
|
if (!definitelyNotNullishShape(value.shape) && value.shape.k === "sum") {
|
|
15431
15561
|
const members = value.shape.members;
|
|
15432
|
-
const kept = members.filter((
|
|
15562
|
+
const kept = members.filter((x) => !isNullishLitAbs(x));
|
|
15433
15563
|
if (kept.length > 0 && kept.length < members.length) {
|
|
15434
15564
|
value = kept.length === 1 ? kept[0] : { ...value, shape: { k: "sum", members: kept } };
|
|
15435
|
-
changed = true;
|
|
15436
15565
|
}
|
|
15437
15566
|
}
|
|
15438
|
-
if (slot.optional)
|
|
15439
|
-
if (!changed) return a;
|
|
15567
|
+
if (value === slot.value && !slot.optional) return { kind: "keep" };
|
|
15440
15568
|
const next = { ...slot, value };
|
|
15441
15569
|
delete next.optional;
|
|
15442
|
-
return {
|
|
15570
|
+
return { kind: "refine", slot: next };
|
|
15443
15571
|
}
|
|
15444
15572
|
function typeofOfMember(m) {
|
|
15445
15573
|
const t = m.term;
|
|
@@ -16842,10 +16970,32 @@ function execRegexBrand(re, method, args) {
|
|
|
16842
16970
|
if (method === "test") {
|
|
16843
16971
|
return abs({ k: "prim", type: "boolean" }, void 0, void 0, "partial");
|
|
16844
16972
|
}
|
|
16845
|
-
|
|
16846
|
-
|
|
16847
|
-
|
|
16848
|
-
|
|
16973
|
+
let probe = null;
|
|
16974
|
+
try {
|
|
16975
|
+
probe = new RegExp(`${parts.pat}|`).exec("");
|
|
16976
|
+
} catch {
|
|
16977
|
+
probe = null;
|
|
16978
|
+
}
|
|
16979
|
+
const nullArm = abs({ k: "unknown" }, { op: "lit", value: null }, void 0, "exact");
|
|
16980
|
+
if (!probe) {
|
|
16981
|
+
const element = joinAbs(str(), undefAbs());
|
|
16982
|
+
return joinAbs(nullArm, abs({ k: "arr", element }, void 0, void 0, "path"));
|
|
16983
|
+
}
|
|
16984
|
+
const ng = probe.length - 1;
|
|
16985
|
+
const slots = {
|
|
16986
|
+
"0": { value: str() },
|
|
16987
|
+
length: { value: numLit(probe.length) },
|
|
16988
|
+
index: { value: num() },
|
|
16989
|
+
input: { value: str() }
|
|
16990
|
+
};
|
|
16991
|
+
for (let i = 1; i <= ng; i++) {
|
|
16992
|
+
slots[String(i)] = { value: joinAbs(str(), undefAbs()) };
|
|
16993
|
+
}
|
|
16994
|
+
const groupNames = probe.groups ? Object.keys(probe.groups) : [];
|
|
16995
|
+
slots["groups"] = {
|
|
16996
|
+
value: groupNames.length ? objOf(Object.fromEntries(groupNames.map((n) => [n, { value: joinAbs(str(), undefAbs()) }]))) : undefAbs()
|
|
16997
|
+
};
|
|
16998
|
+
return joinAbs(nullArm, abs({ k: "obj", slots }, void 0, void 0, "path"));
|
|
16849
16999
|
}
|
|
16850
17000
|
try {
|
|
16851
17001
|
return regexExecWithState(re, method, subject).result;
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
withEvalBudgetOverride,
|
|
47
47
|
withExecPhi,
|
|
48
48
|
withFnBudgetOverride
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-HD6XZFOU.js";
|
|
50
50
|
|
|
51
51
|
// src/algebra/directive-scan.ts
|
|
52
52
|
function cleanDirectiveLine(raw, kind) {
|
|
@@ -2240,8 +2240,13 @@ function formatEffectiveInterfaceDisplay(eff) {
|
|
|
2240
2240
|
if (eff.returns) s += ` \u2192 ${formatConstraint(eff.returns.constraint)}`;
|
|
2241
2241
|
return s;
|
|
2242
2242
|
}
|
|
2243
|
-
|
|
2244
|
-
|
|
2243
|
+
var INTERFACE_SOURCE_ABBR = {
|
|
2244
|
+
handwritten: "hw",
|
|
2245
|
+
generated: "gen",
|
|
2246
|
+
implicit: "imp"
|
|
2247
|
+
};
|
|
2248
|
+
function formatInterfaceTierLine(source, active = true) {
|
|
2249
|
+
return `${active ? "\u25CF" : "\u25CB"} contract / ${INTERFACE_SOURCE_ABBR[source]}`;
|
|
2245
2250
|
}
|
|
2246
2251
|
function interfaceTierOf(source, fnName, fromFile, opts = {}) {
|
|
2247
2252
|
if (!localNamedExports(source).has(fnName)) return void 0;
|
|
@@ -2469,11 +2474,11 @@ function sidecarSpecsOf(source) {
|
|
|
2469
2474
|
(spec) => (spec.startsWith(".") || spec.startsWith("/")) && (spec.endsWith(".nudo.js") || spec.endsWith(".nudo.ts"))
|
|
2470
2475
|
);
|
|
2471
2476
|
}
|
|
2472
|
-
function
|
|
2477
|
+
function tryLoadDeps(loadModule, spec, from) {
|
|
2473
2478
|
try {
|
|
2474
|
-
return loadModule(spec, from);
|
|
2479
|
+
return { src: loadModule(spec, from), err: false };
|
|
2475
2480
|
} catch {
|
|
2476
|
-
return void 0;
|
|
2481
|
+
return { src: void 0, err: true };
|
|
2477
2482
|
}
|
|
2478
2483
|
}
|
|
2479
2484
|
function loadModuleDepsFingerprint(source, loadModule, fromFile) {
|
|
@@ -2486,16 +2491,35 @@ function loadModuleDepsFingerprint(source, loadModule, fromFile) {
|
|
|
2486
2491
|
);
|
|
2487
2492
|
let n = 0;
|
|
2488
2493
|
let truncated = false;
|
|
2494
|
+
let readError = false;
|
|
2495
|
+
const load = (spec, from) => {
|
|
2496
|
+
const a = tryLoadDeps(loadModule, spec, from);
|
|
2497
|
+
if (a.err) readError = true;
|
|
2498
|
+
return a;
|
|
2499
|
+
};
|
|
2489
2500
|
const finish = () => {
|
|
2490
2501
|
parts.sort();
|
|
2491
|
-
|
|
2502
|
+
const prefix = truncated ? "trunc:" : readError ? "readerr:" : "";
|
|
2503
|
+
return {
|
|
2504
|
+
fp: `${prefix}${parts.join(",")}`,
|
|
2505
|
+
paths,
|
|
2506
|
+
contents,
|
|
2507
|
+
truncated,
|
|
2508
|
+
readError
|
|
2509
|
+
};
|
|
2492
2510
|
};
|
|
2493
2511
|
const absorbSidecarClosure = (entryFile) => {
|
|
2494
2512
|
const sidecarPath = sidecarPathOf(entryFile);
|
|
2495
2513
|
if (seen.has(sidecarPath)) return;
|
|
2496
2514
|
const sidecarSpec = `./${sidecarPath.slice(sidecarPath.lastIndexOf("/") + 1)}`;
|
|
2497
|
-
const
|
|
2498
|
-
if (
|
|
2515
|
+
const root = load(sidecarSpec, entryFile);
|
|
2516
|
+
if (root.err) {
|
|
2517
|
+
paths.push(sidecarPath);
|
|
2518
|
+
contents.push({ path: sidecarPath, content: null });
|
|
2519
|
+
return;
|
|
2520
|
+
}
|
|
2521
|
+
if (root.src === void 0) return;
|
|
2522
|
+
const sidecarSrc = root.src;
|
|
2499
2523
|
if (n >= MAX_LOAD_DEP_NODES) {
|
|
2500
2524
|
truncated = true;
|
|
2501
2525
|
return;
|
|
@@ -2518,7 +2542,7 @@ function loadModuleDepsFingerprint(source, loadModule, fromFile) {
|
|
|
2518
2542
|
if (seen.has(path)) continue;
|
|
2519
2543
|
seen.add(path);
|
|
2520
2544
|
n++;
|
|
2521
|
-
const src =
|
|
2545
|
+
const src = load(cur.spec, cur.from).src;
|
|
2522
2546
|
parts.push(`sidecar:${path}=${src === void 0 ? "miss" : hashSource(src)}`);
|
|
2523
2547
|
paths.push(path);
|
|
2524
2548
|
contents.push({ path, content: src ?? null });
|
|
@@ -2539,7 +2563,7 @@ function loadModuleDepsFingerprint(source, loadModule, fromFile) {
|
|
|
2539
2563
|
if (seen.has(path)) continue;
|
|
2540
2564
|
seen.add(path);
|
|
2541
2565
|
n++;
|
|
2542
|
-
const src =
|
|
2566
|
+
const src = load(cur.spec, cur.from).src;
|
|
2543
2567
|
parts.push(`${path}=${src === void 0 ? "miss" : hashSource(src)}`);
|
|
2544
2568
|
paths.push(path);
|
|
2545
2569
|
contents.push({ path, content: src ?? null });
|
|
@@ -3175,7 +3199,7 @@ function loadModuleId(fn) {
|
|
|
3175
3199
|
}
|
|
3176
3200
|
function refineDepsFingerprint(source, refine) {
|
|
3177
3201
|
if (!refine?.loadModule || !refine.fromFile) {
|
|
3178
|
-
return { fp: "-", paths: [], contents: [], truncated: false };
|
|
3202
|
+
return { fp: "-", paths: [], contents: [], truncated: false, readError: false };
|
|
3179
3203
|
}
|
|
3180
3204
|
return loadModuleDepsFingerprint(source, refine.loadModule, refine.fromFile);
|
|
3181
3205
|
}
|
|
@@ -3193,7 +3217,7 @@ function moduleMapId(m) {
|
|
|
3193
3217
|
function generalizeMemoKey(fnName, source, opts) {
|
|
3194
3218
|
const r = opts.refine;
|
|
3195
3219
|
const budget = opts.budget ?? defaultLeakBudget;
|
|
3196
|
-
const deps = opts.depsFp ?? (r ? refineDepsFingerprint(source, r) : { fp: "-", paths: [], contents: [], truncated: false });
|
|
3220
|
+
const deps = opts.depsFp ?? (r ? refineDepsFingerprint(source, r) : { fp: "-", paths: [], contents: [], truncated: false, readError: false });
|
|
3197
3221
|
const sc = opts.sidecarFp ?? (r?.loadModule && r.fromFile ? sidecarClosureFingerprint(r.fromFile, r) : void 0);
|
|
3198
3222
|
const scPath = sc !== void 0 && !sc.startsWith("trunc:") && r?.fromFile ? sidecarPathOf(r.fromFile) : void 0;
|
|
3199
3223
|
const srcPart = generalizeSourceKeyPart(source, fnName, opts.file);
|
|
@@ -3211,7 +3235,7 @@ function generalizeMemoKey(fnName, source, opts) {
|
|
|
3211
3235
|
return {
|
|
3212
3236
|
key,
|
|
3213
3237
|
depPaths: scPath !== void 0 ? [...deps.paths, scPath] : deps.paths,
|
|
3214
|
-
truncated: deps.truncated || (sc?.startsWith("trunc:") ?? false)
|
|
3238
|
+
truncated: deps.truncated || deps.readError || (sc?.startsWith("trunc:") ?? false)
|
|
3215
3239
|
};
|
|
3216
3240
|
}
|
|
3217
3241
|
function generalizeMemoGet(key) {
|
|
@@ -5305,6 +5329,7 @@ export {
|
|
|
5305
5329
|
sidecarClosureFingerprint,
|
|
5306
5330
|
formatConstraint,
|
|
5307
5331
|
formatEffectiveInterfaceDisplay,
|
|
5332
|
+
INTERFACE_SOURCE_ABBR,
|
|
5308
5333
|
formatInterfaceTierLine,
|
|
5309
5334
|
interfaceTierOf,
|
|
5310
5335
|
interfaceSourceOf,
|
package/dist/exec.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as Abs, M as MayThrowEffect, b as Phi } from './run-
|
|
2
|
-
export { W as $assignRecord, X as $call, Y as $callNamed, Z as $recordBinding, a5 as EvalAbsAssignRecord, a6 as EvalCallRecord, a7 as EvalFallback,
|
|
1
|
+
import { A as Abs, M as MayThrowEffect, b as Phi } from './run-WZKUu1y1.js';
|
|
2
|
+
export { W as $assignRecord, X as $call, Y as $callNamed, Z as $recordBinding, a5 as EvalAbsAssignRecord, a6 as EvalCallRecord, a7 as EvalFallback, g as EvalFallbackStats, aa as MAX_EVAL_CALL_DEPTH, ab as MAX_EVAL_TOTAL_CALLS, ac as RUNTIME_IMPORT_RE, V as RunTranspiledOptions, ae as TranspiledCallResult, as as bindingsOf, av as callTranspiledExport, aw as callTranspiledExportApply, ax as callTranspiledExportFull, l as clearPureCallMemo, m as clearPureMemo, n as enterEvalCallBudgetSession, aC as evalExprAbs, p as exitEvalCallBudgetSession, v as getEvalCallBudgetState, aF as getEvalCallCollector, w as getEvalFallbackStats, aN as isAbsVal, b3 as noteEvalCallRecord, b4 as noteEvalFallback, bl as resetEvalCallBudget, H as resetEvalFallbackStats, bF as routeApplyThrows, bm as runTranspiled, bn as runTranspiledOptionsMemoKey, bo as setEvalAssignCollector, bp as setEvalBindingSink, bq as setEvalCallCollector, br as setEvalFallbackCollector, bC as tryRunTranspiled, O as withEvalBudgetOverride } from './run-WZKUu1y1.js';
|
|
3
3
|
import { Node, Expression, File } from '@babel/types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -468,13 +468,23 @@ declare function $removeNull(a: Abs): Abs;
|
|
|
468
468
|
*/
|
|
469
469
|
declare function $removeUndefined(a: Abs): Abs;
|
|
470
470
|
/**
|
|
471
|
-
* 成员真值守卫臂剪影(issue #118):`if (o.p)` 真值臂 / `if (!o.p)`
|
|
472
|
-
* `o?.p` 真值守卫里,槽 p 的值必为真值 ⇒ 非 nullish
|
|
473
|
-
* slots:槽值过与 $removeNullish 同款成员剥离,并摘除 optional
|
|
474
|
-
*
|
|
471
|
+
* 成员真值守卫臂剪影(issue #118 / #129):`if (o.p)` 真值臂 / `if (!o.p)`
|
|
472
|
+
* 假值臂 / `o?.p` 真值守卫里,槽 p 的值必为真值 ⇒ 非 nullish 且槽必在场——
|
|
473
|
+
* 重建 obj slots:槽值过与 $removeNullish 同款成员剥离,并摘除 optional
|
|
474
|
+
* 标记(真值 ⇒ 在场;$get 的 join(value, undef) 随之消失)。槽值剥空(纯
|
|
475
475
|
* nullish)→ 保守原样(臂不可达近似,与 $removeNullish 空集口径一致);
|
|
476
476
|
* 键缺席 / 非 obj / 裸宿主值 → 透传(同 $removeNullish 契约)。真值 ⇒ 非
|
|
477
477
|
* nullish 是 sound 下界:0/''/false 等 falsy-but-not-nullish 成员保留。
|
|
478
|
+
*
|
|
479
|
+
* sum 容器(issue #129):判别窄化后参数常为多臂 union——守卫事实按成员
|
|
480
|
+
* 分发:key 槽确定 nullish 的成员(闭 shape 槽缺席且缺席读确定 undefined
|
|
481
|
+
* ——open/index/proto 方法名/getter 均不在场;或槽值整体 nullish)在真值
|
|
482
|
+
* 守卫下必走早退 → 剪除;其余成员按 obj 分支同款重建(重建迁移
|
|
483
|
+
* accessor/propFlags/nullProto 侧表)。open/index 缺席(读 unknown 不可
|
|
484
|
+
* 判)/ proto 方法名与 constructor 缺席(原型链读出函数)/ getter-only
|
|
485
|
+
* 缺席(读 getter 结果)/ any / unknown 槽值 / 非对象成员不可判保留(宁
|
|
486
|
+
* 缺毋假,与 $get 缺席读同口径)。全剪空 → 原样;单成员剪余塌缩(与
|
|
487
|
+
* $narrowMemberEq 同口径)。
|
|
478
488
|
*/
|
|
479
489
|
declare function $removeMemberNullish(a: Abs, key: string): Abs;
|
|
480
490
|
/**
|
package/dist/exec.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { W as $assignRecord, X as $call, Y as $callNamed, Z as $recordBinding, _ as AbsApplyNoThrow, a0 as AbsApplyNoThrowFn, a1 as AbsApplyResult, a2 as AbsApplyReturn, a3 as AbsFnImpl, a4 as AbsSigImpl, a5 as EvalAbsAssignRecord, a6 as EvalCallRecord, a7 as EvalFallback, a8 as ImplicationOracle, a9 as LitValueResult, L as LiteralValue, aa as MAX_EVAL_CALL_DEPTH, ab as MAX_EVAL_TOTAL_CALLS, P as PrimName, ac as RUNTIME_IMPORT_RE, ad as TYPEOF_NAMES, ae as TranspiledCallResult, af as TypeofName, ag as abs, ah as absFunction, ai as absOnly, aj as absToString, ak as and, al as anyAbs, am as anyVar, an as app, ao as assumeFinite, ap as attachFnImpl, aq as bigintLit, ar as bindImports, as as bindingsOf, at as bool, au as boolLit, av as callTranspiledExport, aw as callTranspiledExportApply, ax as callTranspiledExportFull, ay as collectAbsExports, az as confJoin, aA as emptyPhi, aB as eq, aC as evalExprAbs, aD as ge, aE as geNum, aF as getEvalCallCollector, aG as getFnImpl, aH as getImplicationOracle, aI as gt, aJ as gtNum, aK as hostFnCtorFacet, aL as implies, aM as isAbsApplyResult, aN as isAbsVal, aO as isBigPrim, aP as isExactLit, aQ as isNumPrim, aR as isStrPrim, aS as le, aT as leNum, aU as lit, aV as litValue, aW as lt, aX as ltNum, aY as makeAbsApplyResult, aZ as markPureFn, a_ as namespaceAbsOf, a$ as ne, b0 as negatePred, b1 as never, b2 as not, b3 as noteEvalCallRecord, b4 as noteEvalFallback, b5 as num, b6 as numLit, b7 as numVar, b8 as obj, b9 as or, ba as pFalse, bb as pTrue, bc as phiAnd, bd as predEquals, be as predToString, bf as predVars, bg as primToTypeof, bh as ptypeof, bi as pureFnNameOf, bj as relationFingerprint, bk as relationFn, bl as resetEvalCallBudget, bm as runTranspiled, bn as runTranspiledOptionsMemoKey, bo as setEvalAssignCollector, bp as setEvalBindingSink, bq as setEvalCallCollector, br as setEvalFallbackCollector, bs as setImplicationOracle, bt as shapeOfTerm, bu as shapeOnlyFn, bv as shapeToString, bw as simplifyTerm, bx as str, by as strLit, bz as substPred, bA as termEquals, bB as termToString, bC as tryRunTranspiled, bD as unknown, bE as v } from './run-
|
|
1
|
+
import { d as AstEnv, A as Abs, b as Phi, T as Term, Q as HofCollectCtx, C as Confidence, S as Shape, a as Pred, R as RelSource, U as HofSite, c as AbsModuleExports, V as RunTranspiledOptions } from './run-WZKUu1y1.js';
|
|
2
|
+
export { W as $assignRecord, X as $call, Y as $callNamed, Z as $recordBinding, _ as AbsApplyNoThrow, a0 as AbsApplyNoThrowFn, a1 as AbsApplyResult, a2 as AbsApplyReturn, a3 as AbsFnImpl, a4 as AbsSigImpl, a5 as EvalAbsAssignRecord, a6 as EvalCallRecord, a7 as EvalFallback, a8 as ImplicationOracle, a9 as LitValueResult, L as LiteralValue, aa as MAX_EVAL_CALL_DEPTH, ab as MAX_EVAL_TOTAL_CALLS, P as PrimName, ac as RUNTIME_IMPORT_RE, ad as TYPEOF_NAMES, ae as TranspiledCallResult, af as TypeofName, ag as abs, ah as absFunction, ai as absOnly, aj as absToString, ak as and, al as anyAbs, am as anyVar, an as app, ao as assumeFinite, ap as attachFnImpl, aq as bigintLit, ar as bindImports, as as bindingsOf, at as bool, au as boolLit, av as callTranspiledExport, aw as callTranspiledExportApply, ax as callTranspiledExportFull, ay as collectAbsExports, az as confJoin, aA as emptyPhi, aB as eq, aC as evalExprAbs, aD as ge, aE as geNum, aF as getEvalCallCollector, aG as getFnImpl, aH as getImplicationOracle, aI as gt, aJ as gtNum, aK as hostFnCtorFacet, aL as implies, aM as isAbsApplyResult, aN as isAbsVal, aO as isBigPrim, aP as isExactLit, aQ as isNumPrim, aR as isStrPrim, aS as le, aT as leNum, aU as lit, aV as litValue, aW as lt, aX as ltNum, aY as makeAbsApplyResult, aZ as markPureFn, a_ as namespaceAbsOf, a$ as ne, b0 as negatePred, b1 as never, b2 as not, b3 as noteEvalCallRecord, b4 as noteEvalFallback, b5 as num, b6 as numLit, b7 as numVar, b8 as obj, b9 as or, ba as pFalse, bb as pTrue, bc as phiAnd, bd as predEquals, be as predToString, bf as predVars, bg as primToTypeof, bh as ptypeof, bi as pureFnNameOf, bj as relationFingerprint, bk as relationFn, bl as resetEvalCallBudget, bm as runTranspiled, bn as runTranspiledOptionsMemoKey, bo as setEvalAssignCollector, bp as setEvalBindingSink, bq as setEvalCallCollector, br as setEvalFallbackCollector, bs as setImplicationOracle, bt as shapeOfTerm, bu as shapeOnlyFn, bv as shapeToString, bw as simplifyTerm, bx as str, by as strLit, bz as substPred, bA as termEquals, bB as termToString, bC as tryRunTranspiled, bD as unknown, bE as v } from './run-WZKUu1y1.js';
|
|
3
3
|
import { Node, File } from '@babel/types';
|
|
4
|
-
import { p as parseSource, L as LeakBudget, E as EffectiveInterfaceOpts, b as LoadDepsFingerprint, v as CheckReport, N as NudoConstraint, c as ProjectionBudget } from './projection-budget-
|
|
5
|
-
export { w as CONSTRAINT_BUILDERS, x as CONSTRAINT_BUILDER_NAMES, y as CONSTRAINT_EXPR_RE, z as CheckAction, C as CheckIssue, A as CheckJson, B as CheckJsonMulti, D as ConstraintBuilder, F as Diagnostic, G as EffectiveInterface, H as GitlabCodeQualityIssue, J as InterfaceDiag, I as InterfaceSource,
|
|
4
|
+
import { p as parseSource, L as LeakBudget, E as EffectiveInterfaceOpts, b as LoadDepsFingerprint, v as CheckReport, N as NudoConstraint, c as ProjectionBudget } from './projection-budget-Dm1YWZ1U.js';
|
|
5
|
+
export { w as CONSTRAINT_BUILDERS, x as CONSTRAINT_BUILDER_NAMES, y as CONSTRAINT_EXPR_RE, z as CheckAction, C as CheckIssue, A as CheckJson, B as CheckJsonMulti, D as ConstraintBuilder, F as Diagnostic, G as EffectiveInterface, H as GitlabCodeQualityIssue, J as INTERFACE_SOURCE_ABBR, K as InterfaceDiag, I as InterfaceSource, O as InterfaceTierInfo, a as InterfaceTierOpts, Q as NamedImport, R as NudoField, S as NudoFnConstraint, T as NudoSidecarError, U as NudoSig, V as RefineDiag, W as RefineEntry, X as RefineResolveOpts, Y as SELF, Z as actionsForIssue, _ as andC, $ as any, a0 as array, a1 as boolean, a2 as checkArg, a3 as checkCall, a4 as constraintAdmitsNullish, a5 as constraintToEntryAbs, a6 as derefConstraint, a7 as drainPromiseMicros, a8 as effectiveInterface, a9 as enterPromiseExecutorScope, aa as evalPromiseCtor, ab as evalPromiseMethod, ac as evalPromiseStatic, ad as execNudoModule, ae as extractDeclaredThrows, af as extractFnBudget, ag as extractNudoImports, ah as extractRefineReturnFromSource, ai as extractRefinesFromSource, aj as fn, ak as fnConstraintToEntryReqs, al as formatCheckReport, am as formatConstraint, an as formatDiagnostics, ao as formatEffectiveInterfaceDisplay, ap as formatGithubAnnotations, aq as formatGitlabCodeQuality, ar as formatInterfaceTierLine, as as generatedExportNames, at as getParseSourceCacheSize, au as getTerm, av as instantiateConstraint, aw as interfaceDiagCount, ax as interfaceSourceOf, ay as interfaceTierOf, az as isIntFlag, aA as isNodeModulesPath, aB as isNudoConstraint, aC as lazy, aD as leavePromiseExecutorScope, aE as lenTerm, aF as litC, aG as localNamedExports, aH as notePromiseExecutorFork, aI as nullable, aJ as number, aK as omit, aL as partial, aM as pick, aN as queuePromiseMicro, aO as refineDiagCount, aP as refineToIndexedFull, aQ as resetNudoModuleExecCache, aR as resetParseSourceCache, aS as resetSidecarLoadFailureCache, aT as serializeCheckJson, aU as serializeCheckJsonMulti, aV as setInterfaceDiagCollector, aW as setRefineDiagCollector, aX as shape, aY as sidecarClosureFingerprint, aZ as sidecarPathOf, a_ as string, a$ as takeInterfaceDiags, b0 as takeInterfaceDiagsSince, b1 as takeRefineDiags, b2 as takeRefineDiagsSince, b3 as throwConstraintToKinds, b4 as union } from './projection-budget-Dm1YWZ1U.js';
|
|
6
6
|
export { $add, $arguments, $arr, $arrMutContainer, $arrRest, $arrWithHoles, $async, $asyncReturn, $await, $bitand, $bitnot, $bitor, $bitxor, $catchVal, $class, $classExpr, $collectionForEach, $concat, $copy, $del, $delRes, $div, $dynamicImport, $elems, $eq, $eqLoose, $fnVal, $for, $forInKeys, $forIter, $forOf, $fork, $ge, $gen, $get, $gt, $idx, $idxSet, $importMeta, $in, $instanceof, $instanceofNonIdent, $invoke, $invokeSuper, $isBreakTo, $isForkExit, $join, $le, $len, $lit, $loopBreak, $loopContinue, $loopReturn, $lt, $mod, $mul, $ne, $neLoose, $neg, $new, $not, $nullishTest, $obj, $objAccessor, $objRest, $optionalGet, $optionalInvoke, $orDefault, $pow, $pushLoopExit, $rawThis, $reStateCall, $regex, $rethrowIfNudoReturn, $set, $setKey, $shl, $shr, $spread, $staticInvoke, $sub, $super, $switch, $thisGet, $thisSet, $throw, $toNumber, $toNumeric, $tryCurrentMark, $tryDetachSoftCatch, $tryDigestSoftCatch, $tryDiscardSoft, $tryMark, $tryOrphanSoft, $tryPopMark, $tryReleaseSoftCatch, $tryReleaseSoftOut, $tryTakeSince, $typeof, $unknown, $updateAdd, $updateSub, $ushr, $while, $whileSeq, $yield, DEFAULT_MAX_LOOP_ITERS, EvalClassSpec, NudoLoopSignal, NudoReturn, NudoThrow, NudoUnsupportedError, TranspileOptions, asAbsVal, callAtFunctionBoundary, clearBClasses, clearStaleTermPred, currentExecPhi, fillTuple, foldRequireSpecArg, foldStaticStringExpr, getEvalClass, isArrMutator, isDefinitelyFalse, isDefinitelyTrue, isNudoBreak, isNudoContinue, isNudoReturn, isNudoThrow, litTruth, lookupObjAccessor, namespaceNameOf, pushLoopExit, pushThrowExit, registerEvalClass, runWithLoopExits, runtimeImportOf, takeLoopExits, takeThrowExits, transpile, transpileBodyNode, transpileExpression, transpileFile, transpileSource, withExecPhi } from './exec.js';
|
|
7
7
|
|
|
8
8
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "./chunk-US532PZA.js";
|
|
2
2
|
import {
|
|
3
|
+
INTERFACE_SOURCE_ABBR,
|
|
3
4
|
NudoSidecarError,
|
|
4
5
|
buildArgsFromAssume,
|
|
5
6
|
canSkipLiteralCallScan,
|
|
@@ -63,7 +64,7 @@ import {
|
|
|
63
64
|
takeInterfaceDiagsSince,
|
|
64
65
|
takeRefineDiags,
|
|
65
66
|
takeRefineDiagsSince
|
|
66
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-VMGJYMIF.js";
|
|
67
68
|
import {
|
|
68
69
|
$add,
|
|
69
70
|
$arguments,
|
|
@@ -519,7 +520,7 @@ import {
|
|
|
519
520
|
v,
|
|
520
521
|
withExecPhi,
|
|
521
522
|
withVar
|
|
522
|
-
} from "./chunk-
|
|
523
|
+
} from "./chunk-HD6XZFOU.js";
|
|
523
524
|
|
|
524
525
|
// src/environment.ts
|
|
525
526
|
function createEnvironment(parent, bindings = /* @__PURE__ */ new Map()) {
|
|
@@ -1629,7 +1630,7 @@ function loadModuleId(fn2) {
|
|
|
1629
1630
|
}
|
|
1630
1631
|
function checkDepsFingerprint(source, opts) {
|
|
1631
1632
|
if (!opts.loadModule || !opts.fromFile) {
|
|
1632
|
-
return { fp: "-", paths: [], contents: [], truncated: false };
|
|
1633
|
+
return { fp: "-", paths: [], contents: [], truncated: false, readError: false };
|
|
1633
1634
|
}
|
|
1634
1635
|
return loadModuleDepsFingerprint(source, opts.loadModule, opts.fromFile);
|
|
1635
1636
|
}
|
|
@@ -2163,7 +2164,9 @@ function checkSourceInScope(filePath, source, phi, opts) {
|
|
|
2163
2164
|
const stable = stableAnalyzeKeySource(source);
|
|
2164
2165
|
const depsFp = checkDepsFingerprint(stable, callOpts);
|
|
2165
2166
|
const sidecarFp = callOpts.loadModule && callOpts.fromFile ? sidecarClosureFingerprint(callOpts.fromFile, callOpts) : void 0;
|
|
2166
|
-
const allowMemo = useMemo && !depsFp.truncated &&
|
|
2167
|
+
const allowMemo = useMemo && !depsFp.truncated && // 读错误轮键不可信(#135):错误轮报告(nudo:interface-load)与真 miss 轮
|
|
2168
|
+
// (干净)若共享 miss 键会互为跨次陈旧命中——不读也不写 memo
|
|
2169
|
+
!depsFp.readError && !(sidecarFp?.startsWith("trunc:") ?? false);
|
|
2167
2170
|
if (allowMemo) {
|
|
2168
2171
|
memoKey = checkMemoKey(filePath, stable, opts, depsFp, sidecarFp);
|
|
2169
2172
|
const hit = checkMemoGet(memoKey);
|
|
@@ -3250,6 +3253,7 @@ export {
|
|
|
3250
3253
|
CONSTRAINT_BUILDER_NAMES,
|
|
3251
3254
|
CONSTRAINT_EXPR_RE,
|
|
3252
3255
|
DEFAULT_MAX_LOOP_ITERS,
|
|
3256
|
+
INTERFACE_SOURCE_ABBR,
|
|
3253
3257
|
MAX_EVAL_CALL_DEPTH,
|
|
3254
3258
|
MAX_EVAL_TOTAL_CALLS,
|
|
3255
3259
|
NudoLoopSignal,
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { I as InterfaceSource, a as InterfaceTierOpts, p as parseSource, C as CheckIssue } from './projection-budget-
|
|
2
|
-
export { L as LeakBudget, b as LoadDepsFingerprint, M as MAX_PROMISE_MICROS, P as PROJECTION_MAX_DEPTH, c as ProjectionBudget, d as ProjectionStopReason, e as defaultLeakBudget, f as exceedsBudget, g as exportedNameOfLocal, h as extractAllLoadSpecs, i as getPromiseMicrosLength, l as leakIfNeeded, j as loadModuleDepsFingerprint, m as maybeLeak, n as normPath, r as resetLeakCounter, k as resolveDepPath, s as sidecarSpecsOf, o as stablePathKey, q as stablePathKeyGraph, t as termDepth, u as termNodes } from './projection-budget-
|
|
3
|
-
import { A as Abs, T as Term, c as AstEnv } from './run-
|
|
4
|
-
export { $ as $tryDigestSoft,
|
|
1
|
+
import { I as InterfaceSource, a as InterfaceTierOpts, p as parseSource, C as CheckIssue } from './projection-budget-Dm1YWZ1U.js';
|
|
2
|
+
export { L as LeakBudget, b as LoadDepsFingerprint, M as MAX_PROMISE_MICROS, P as PROJECTION_MAX_DEPTH, c as ProjectionBudget, d as ProjectionStopReason, e as defaultLeakBudget, f as exceedsBudget, g as exportedNameOfLocal, h as extractAllLoadSpecs, i as getPromiseMicrosLength, l as leakIfNeeded, j as loadModuleDepsFingerprint, m as maybeLeak, n as normPath, r as resetLeakCounter, k as resolveDepPath, s as sidecarSpecsOf, o as stablePathKey, q as stablePathKeyGraph, t as termDepth, u as termNodes } from './projection-budget-Dm1YWZ1U.js';
|
|
3
|
+
import { A as Abs, T as Term, c as AbsModuleExports, d as AstEnv } from './run-WZKUu1y1.js';
|
|
4
|
+
export { $ as $tryDigestSoft, e as $tryMarkSoft, f as $tryReleaseSoft, E as ERROR_FAMILY, g as EvalFallbackStats, M as MayThrowEffect, h as absLit, i as absNumLit, j as absStrLit, k as allAbsStr, l as clearPureCallMemo, m as clearPureMemo, n as enterEvalCallBudgetSession, o as errorTypeAbs, p as exitEvalCallBudgetSession, q as filterDeclaredThrows, r as filterGateThrows, s as filterIgnoredThrows, t as flushMayThrowEffects, u as formatThrowsAbs, v as getEvalCallBudgetState, w as getEvalFallbackStats, x as getMayThrowCollector, y as isThrowsIgnored, z as mayThrowEffectsToAbs, B as orphanMayThrowEffects, D as popMayThrowFrame, F as pushMayThrowFrame, G as recordMayThrow, H as resetEvalFallbackStats, I as runWithMayThrowSession, J as setMayThrowCollector, K as throwAbsToKinds, N as throwsKindCovered, O as withEvalBudgetOverride } from './run-WZKUu1y1.js';
|
|
5
5
|
import { File, Node } from '@babel/types';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -389,6 +389,11 @@ type AbsInlay = {
|
|
|
389
389
|
type CollectAbsInlaysOpts = InterfaceTierOpts & {
|
|
390
390
|
loadModule?: (spec: string, fromFile: string) => string | undefined;
|
|
391
391
|
fromFile?: string;
|
|
392
|
+
/**
|
|
393
|
+
* eval 模块图(host 组装,如 service `evalAbsModuleGraph`)。缺省时
|
|
394
|
+
* generalizeFromAst 看不到跨模块 import → 调用塌缩 unknown(inlay 假空)。
|
|
395
|
+
*/
|
|
396
|
+
modules?: Record<string, AbsModuleExports | Record<string, unknown>>;
|
|
392
397
|
};
|
|
393
398
|
/**
|
|
394
399
|
* 收集源码中函数签名的 Abs inlay:
|
package/dist/internal.js
CHANGED
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
stableAnalyzeKeySource,
|
|
22
22
|
stablePathKey,
|
|
23
23
|
stablePathKeyGraph
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-VMGJYMIF.js";
|
|
25
25
|
import {
|
|
26
26
|
$tryDigestSoft,
|
|
27
27
|
$tryMarkSoft,
|
|
@@ -169,7 +169,7 @@ import {
|
|
|
169
169
|
withEvalBudgetOverride,
|
|
170
170
|
withFnBudgetOverride,
|
|
171
171
|
wrapPromise
|
|
172
|
-
} from "./chunk-
|
|
172
|
+
} from "./chunk-HD6XZFOU.js";
|
|
173
173
|
|
|
174
174
|
// src/algebra/inlay.ts
|
|
175
175
|
function listFunctions(source) {
|
|
@@ -258,12 +258,16 @@ function collectAbsInlays(source, opts) {
|
|
|
258
258
|
const inlays = [];
|
|
259
259
|
const refineOpts = opts?.loadModule || opts?.fromFile ? {
|
|
260
260
|
...opts.loadModule ? { loadModule: opts.loadModule } : {},
|
|
261
|
-
...opts.fromFile ? { fromFile: opts.fromFile } : {}
|
|
261
|
+
...opts.fromFile ? { fromFile: opts.fromFile } : {},
|
|
262
|
+
...opts.autoBind !== void 0 ? { autoBind: opts.autoBind } : {}
|
|
262
263
|
} : void 0;
|
|
263
264
|
for (const { name, node } of listFunctions(source)) {
|
|
264
265
|
let g;
|
|
265
266
|
try {
|
|
266
|
-
g = generalizeFromAst(name, source,
|
|
267
|
+
g = generalizeFromAst(name, source, {
|
|
268
|
+
...refineOpts ? { refine: refineOpts } : {},
|
|
269
|
+
...opts?.modules ? { modules: opts.modules } : {}
|
|
270
|
+
});
|
|
267
271
|
} catch {
|
|
268
272
|
continue;
|
|
269
273
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { File } from '@babel/types';
|
|
2
|
-
import { A as Abs, T as Term, P as PrimName, a as Pred, L as LiteralValue, b as Phi, C as Confidence } from './run-
|
|
2
|
+
import { A as Abs, T as Term, P as PrimName, a as Pred, L as LiteralValue, b as Phi, C as Confidence } from './run-WZKUu1y1.js';
|
|
3
3
|
|
|
4
4
|
declare function resetParseSourceCache(): void;
|
|
5
5
|
declare function getParseSourceCacheSize(): number;
|
|
@@ -525,8 +525,14 @@ declare function sidecarClosureFingerprint(fromFile: string, opts: EffectiveInte
|
|
|
525
525
|
declare function formatConstraint(c: NudoConstraint): string;
|
|
526
526
|
/** EffectiveInterface → 契约展示串(与 CLI interface 打印同口径,不含函数名) */
|
|
527
527
|
declare function formatEffectiveInterfaceDisplay(eff: EffectiveInterface): string;
|
|
528
|
-
/**
|
|
529
|
-
declare
|
|
528
|
+
/** 档位源缩写:handwritten=hw / generated=gen / implicit=imp */
|
|
529
|
+
declare const INTERFACE_SOURCE_ABBR: Record<InterfaceSource, string>;
|
|
530
|
+
/**
|
|
531
|
+
* CodeLens / hover 首行标题(design-refine-derivation §8):`● contract / hw|gen|imp`。
|
|
532
|
+
* contract 是观察选择器的一个选项(与各 case 互斥):`active=false` 时渲染 `○`,
|
|
533
|
+
* 表示该函数当前观察的是某个 case 而非契约。
|
|
534
|
+
*/
|
|
535
|
+
declare function formatInterfaceTierLine(source: InterfaceSource, active?: boolean): string;
|
|
530
536
|
type InterfaceTierInfo = {
|
|
531
537
|
source: InterfaceSource;
|
|
532
538
|
/** handwritten/generated 时的契约展示;implicit 为 undefined */
|
|
@@ -558,6 +564,12 @@ type LoadDepsFingerprint = {
|
|
|
558
564
|
}>;
|
|
559
565
|
/** BFS 撞到节点上限:剩余 dep 未进指纹,键不可信 */
|
|
560
566
|
truncated: boolean;
|
|
567
|
+
/**
|
|
568
|
+
* 任一装载 throw(EACCES/EMFILE/…)≠ 真 miss:读错误轮的报告(含
|
|
569
|
+
* nudo:interface-load)与真 miss 轮(干净)内容不同,折叠成同一 miss 键
|
|
570
|
+
* 会互为跨次陈旧命中(#135)。fp 带 `readerr:` 前缀,调用方 fail-open 禁 memo。
|
|
571
|
+
*/
|
|
572
|
+
readError: boolean;
|
|
561
573
|
};
|
|
562
574
|
/**
|
|
563
575
|
* All string module specs that analysis may resolve through loadModule.
|
|
@@ -831,4 +843,4 @@ declare class ProjectionBudget {
|
|
|
831
843
|
exit(): void;
|
|
832
844
|
}
|
|
833
845
|
|
|
834
|
-
export {
|
|
846
|
+
export { any as $, type CheckJson as A, type CheckJsonMulti as B, type CheckIssue as C, type ConstraintBuilder as D, type EffectiveInterfaceOpts as E, type Diagnostic as F, type EffectiveInterface as G, type GitlabCodeQualityIssue as H, type InterfaceSource as I, INTERFACE_SOURCE_ABBR as J, type InterfaceDiag as K, type LeakBudget as L, MAX_PROMISE_MICROS as M, type NudoConstraint as N, type InterfaceTierInfo as O, PROJECTION_MAX_DEPTH as P, type NamedImport as Q, type NudoField as R, type NudoFnConstraint as S, NudoSidecarError as T, type NudoSig as U, type RefineDiag as V, type RefineEntry as W, type RefineResolveOpts as X, SELF as Y, actionsForIssue as Z, andC as _, type InterfaceTierOpts as a, takeInterfaceDiags as a$, array as a0, boolean as a1, checkArg as a2, checkCall as a3, constraintAdmitsNullish as a4, constraintToEntryAbs as a5, derefConstraint as a6, drainPromiseMicros as a7, effectiveInterface as a8, enterPromiseExecutorScope as a9, isNodeModulesPath as aA, isNudoConstraint as aB, lazy as aC, leavePromiseExecutorScope as aD, lenTerm as aE, litC as aF, localNamedExports as aG, notePromiseExecutorFork as aH, nullable as aI, number as aJ, omit as aK, partial as aL, pick as aM, queuePromiseMicro as aN, refineDiagCount as aO, refineToIndexedFull as aP, resetNudoModuleExecCache as aQ, resetParseSourceCache as aR, resetSidecarLoadFailureCache as aS, serializeCheckJson as aT, serializeCheckJsonMulti as aU, setInterfaceDiagCollector as aV, setRefineDiagCollector as aW, shape as aX, sidecarClosureFingerprint as aY, sidecarPathOf as aZ, string as a_, evalPromiseCtor as aa, evalPromiseMethod as ab, evalPromiseStatic as ac, execNudoModule as ad, extractDeclaredThrows as ae, extractFnBudget as af, extractNudoImports as ag, extractRefineReturnFromSource as ah, extractRefinesFromSource as ai, fn as aj, fnConstraintToEntryReqs as ak, formatCheckReport as al, formatConstraint as am, formatDiagnostics as an, formatEffectiveInterfaceDisplay as ao, formatGithubAnnotations as ap, formatGitlabCodeQuality as aq, formatInterfaceTierLine as ar, generatedExportNames as as, getParseSourceCacheSize as at, getTerm as au, instantiateConstraint as av, interfaceDiagCount as aw, interfaceSourceOf as ax, interfaceTierOf as ay, isIntFlag as az, type LoadDepsFingerprint as b, takeInterfaceDiagsSince as b0, takeRefineDiags as b1, takeRefineDiagsSince as b2, throwConstraintToKinds as b3, union as b4, ProjectionBudget as c, type ProjectionStopReason as d, defaultLeakBudget as e, exceedsBudget as f, exportedNameOfLocal as g, extractAllLoadSpecs as h, getPromiseMicrosLength as i, loadModuleDepsFingerprint as j, resolveDepPath as k, leakIfNeeded as l, maybeLeak as m, normPath as n, stablePathKey as o, parseSource as p, stablePathKeyGraph as q, resetLeakCounter as r, sidecarSpecsOf as s, termDepth as t, termNodes as u, type CheckReport as v, CONSTRAINT_BUILDERS as w, CONSTRAINT_BUILDER_NAMES as x, CONSTRAINT_EXPR_RE as y, type CheckAction as z };
|
|
@@ -817,4 +817,4 @@ declare function callTranspiledExport(exports: Record<string, unknown>, name: st
|
|
|
817
817
|
*/
|
|
818
818
|
declare function callTranspiledExportApply(exports: Record<string, unknown> | (() => Record<string, unknown>), name: string): (args: Abs[], thisVal?: Abs) => AbsApplyResult;
|
|
819
819
|
|
|
820
|
-
export { $tryDigestSoft as $, type Abs as A,
|
|
820
|
+
export { $tryDigestSoft as $, type Abs as A, orphanMayThrowEffects as B, type Confidence as C, popMayThrowFrame as D, ERROR_FAMILY as E, pushMayThrowFrame as F, recordMayThrow as G, resetEvalFallbackStats as H, runWithMayThrowSession as I, setMayThrowCollector as J, throwAbsToKinds as K, type LiteralValue as L, type MayThrowEffect as M, throwsKindCovered as N, withEvalBudgetOverride as O, type PrimName as P, type HofCollectCtx as Q, type RelSource as R, type Shape as S, type Term as T, type HofSite as U, type RunTranspiledOptions as V, $assignRecord as W, $call as X, $callNamed as Y, $recordBinding as Z, type AbsApplyNoThrow as _, type Pred as a, ne as a$, type AbsApplyNoThrowFn as a0, type AbsApplyResult as a1, type AbsApplyReturn as a2, type AbsFnImpl as a3, type AbsSigImpl as a4, type EvalAbsAssignRecord as a5, type EvalCallRecord as a6, type EvalFallback as a7, type ImplicationOracle as a8, type LitValueResult as a9, emptyPhi as aA, eq as aB, evalExprAbs as aC, ge as aD, geNum as aE, getEvalCallCollector as aF, getFnImpl as aG, getImplicationOracle as aH, gt as aI, gtNum as aJ, hostFnCtorFacet as aK, implies as aL, isAbsApplyResult as aM, isAbsVal as aN, isBigPrim as aO, isExactLit as aP, isNumPrim as aQ, isStrPrim as aR, le as aS, leNum as aT, lit as aU, litValue as aV, lt as aW, ltNum as aX, makeAbsApplyResult as aY, markPureFn as aZ, namespaceAbsOf as a_, MAX_EVAL_CALL_DEPTH as aa, MAX_EVAL_TOTAL_CALLS as ab, RUNTIME_IMPORT_RE as ac, TYPEOF_NAMES as ad, type TranspiledCallResult as ae, type TypeofName as af, abs as ag, absFunction as ah, absOnly as ai, absToString as aj, and as ak, anyAbs as al, anyVar as am, app as an, assumeFinite as ao, attachFnImpl as ap, bigintLit as aq, bindImports as ar, bindingsOf as as, bool as at, boolLit as au, callTranspiledExport as av, callTranspiledExportApply as aw, callTranspiledExportFull as ax, collectAbsExports as ay, confJoin as az, type Phi as b, negatePred as b0, never as b1, not as b2, noteEvalCallRecord as b3, noteEvalFallback as b4, num as b5, numLit as b6, numVar as b7, obj as b8, or as b9, termEquals as bA, termToString as bB, tryRunTranspiled as bC, unknown as bD, v as bE, routeApplyThrows as bF, pFalse as ba, pTrue as bb, phiAnd as bc, predEquals as bd, predToString as be, predVars as bf, primToTypeof as bg, ptypeof as bh, pureFnNameOf as bi, relationFingerprint as bj, relationFn as bk, resetEvalCallBudget as bl, runTranspiled as bm, runTranspiledOptionsMemoKey as bn, setEvalAssignCollector as bo, setEvalBindingSink as bp, setEvalCallCollector as bq, setEvalFallbackCollector as br, setImplicationOracle as bs, shapeOfTerm as bt, shapeOnlyFn as bu, shapeToString as bv, simplifyTerm as bw, str as bx, strLit as by, substPred as bz, type AbsModuleExports as c, type AstEnv as d, $tryMarkSoft as e, $tryReleaseSoft as f, type EvalFallbackStats as g, absLit as h, absNumLit as i, absStrLit as j, allAbsStr as k, clearPureCallMemo as l, clearPureMemo as m, enterEvalCallBudgetSession as n, errorTypeAbs as o, exitEvalCallBudgetSession as p, filterDeclaredThrows as q, filterGateThrows as r, filterIgnoredThrows as s, flushMayThrowEffects as t, formatThrowsAbs as u, getEvalCallBudgetState as v, getEvalFallbackStats as w, getMayThrowCollector as x, isThrowsIgnored as y, mayThrowEffectsToAbs as z };
|