@nudojs/core 1.1.4 → 1.2.2
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/{check-report-AtnAfY9U.d.ts → check-report-0B9Z66n0.d.ts} +1 -1
- package/dist/{chunk-SQSO4NKT.js → chunk-4V3CRVSD.js} +931 -396
- package/dist/{chunk-XOHKHJHE.js → chunk-TOURNNEA.js} +34 -34
- package/dist/exec.d.ts +2 -2
- package/dist/exec.js +33 -25
- package/dist/{hof-types-tAeoYvzY.d.ts → hof-types-DqDpAxfh.d.ts} +17 -3
- package/dist/{index-D4rnOHre.d.ts → index-BNiZvVHw.d.ts} +53 -40
- package/dist/index.d.ts +37 -20
- package/dist/index.js +61 -50
- package/dist/internal.d.ts +26 -26
- package/dist/internal.js +16 -16
- package/package.json +1 -1
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
unknown,
|
|
42
42
|
v,
|
|
43
43
|
withExecPhi
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-4V3CRVSD.js";
|
|
45
45
|
|
|
46
46
|
// src/algebra/constraint.ts
|
|
47
47
|
var SELF = "__nudo_self__";
|
|
@@ -2541,9 +2541,9 @@ function promoteAsFn(ctx, name, args, loc) {
|
|
|
2541
2541
|
loc
|
|
2542
2542
|
});
|
|
2543
2543
|
}
|
|
2544
|
-
function promoteCb(ctx,
|
|
2545
|
-
if (!ctx.params.has(
|
|
2546
|
-
const prev = ctx.shapes.get(
|
|
2544
|
+
function promoteCb(ctx, cevalName, method, argTerms, loc) {
|
|
2545
|
+
if (!ctx.params.has(cevalName)) return;
|
|
2546
|
+
const prev = ctx.shapes.get(cevalName);
|
|
2547
2547
|
if (!prev) return;
|
|
2548
2548
|
if (prev.shape.k !== "any" && prev.shape.k !== "unknown") return;
|
|
2549
2549
|
let paramTypes;
|
|
@@ -2553,7 +2553,7 @@ function promoteCb(ctx, cbName, method, argTerms, loc) {
|
|
|
2553
2553
|
returnType = abs({ k: "prim", type: "boolean" }, void 0, void 0, "path");
|
|
2554
2554
|
} else {
|
|
2555
2555
|
paramTypes = argTerms.map((t) => abs({ k: "any" }, t, void 0, "path"));
|
|
2556
|
-
returnType = abs({ k: "any" }, v(`B:${
|
|
2556
|
+
returnType = abs({ k: "any" }, v(`B:${cevalName}`), void 0, "path");
|
|
2557
2557
|
}
|
|
2558
2558
|
const fnShape = {
|
|
2559
2559
|
k: "fn",
|
|
@@ -2561,9 +2561,9 @@ function promoteCb(ctx, cbName, method, argTerms, loc) {
|
|
|
2561
2561
|
paramTypes,
|
|
2562
2562
|
returnType
|
|
2563
2563
|
};
|
|
2564
|
-
promoteShape(ctx,
|
|
2564
|
+
promoteShape(ctx, cevalName, fnShape, loc, false);
|
|
2565
2565
|
ctx.sites.push({
|
|
2566
|
-
param:
|
|
2566
|
+
param: cevalName,
|
|
2567
2567
|
argTerms,
|
|
2568
2568
|
result: returnType,
|
|
2569
2569
|
loc
|
|
@@ -2675,14 +2675,14 @@ function scanPromotions(body, params, paramTermIds, initialShapes) {
|
|
|
2675
2675
|
}
|
|
2676
2676
|
|
|
2677
2677
|
// src/algebra/generalize.ts
|
|
2678
|
-
var
|
|
2679
|
-
function
|
|
2678
|
+
var evalRunMemo = /* @__PURE__ */ new Map();
|
|
2679
|
+
function evalRunOf(source, modules, inject) {
|
|
2680
2680
|
const mKey = `${source}|${runTranspiledOptionsMemoKey({ ...inject ?? {}, ...modules ? { modules } : {} })}`;
|
|
2681
|
-
if (
|
|
2682
|
-
const oldest =
|
|
2683
|
-
if (oldest !== void 0)
|
|
2681
|
+
if (evalRunMemo.size >= 256) {
|
|
2682
|
+
const oldest = evalRunMemo.keys().next().value;
|
|
2683
|
+
if (oldest !== void 0) evalRunMemo.delete(oldest);
|
|
2684
2684
|
}
|
|
2685
|
-
let run =
|
|
2685
|
+
let run = evalRunMemo.get(mKey);
|
|
2686
2686
|
if (run === void 0) {
|
|
2687
2687
|
const merged = modules ?? inject?.modules;
|
|
2688
2688
|
const r = tryRunTranspiled(source, {
|
|
@@ -2692,7 +2692,7 @@ function bPathRunOf(source, modules, inject) {
|
|
|
2692
2692
|
});
|
|
2693
2693
|
if (r === void 0) return void 0;
|
|
2694
2694
|
run = r;
|
|
2695
|
-
|
|
2695
|
+
evalRunMemo.set(mKey, run);
|
|
2696
2696
|
}
|
|
2697
2697
|
return run;
|
|
2698
2698
|
}
|
|
@@ -3090,7 +3090,7 @@ function generalizeFromAstUncached(fnName, source, opts = {}) {
|
|
|
3090
3090
|
);
|
|
3091
3091
|
const envGated = envGatedSource && freeIdentifiers(body, boundNames).size > 0;
|
|
3092
3092
|
const replaceGated = /@nudo:replace\b/.test(source) && !hasReps;
|
|
3093
|
-
const
|
|
3093
|
+
const evalEligible = !unresolvableImports && !mockGated && !envGated && !replaceGated;
|
|
3094
3094
|
const run = (args, phi = pTrue) => {
|
|
3095
3095
|
const { key, varOrder } = instantiateMemoKey(args, phi);
|
|
3096
3096
|
const hit = instMemo.get(key);
|
|
@@ -3098,27 +3098,27 @@ function generalizeFromAstUncached(fnName, source, opts = {}) {
|
|
|
3098
3098
|
return alphaRenameResult(hit.result, hit.varOrder, varOrder);
|
|
3099
3099
|
}
|
|
3100
3100
|
let result;
|
|
3101
|
-
if (
|
|
3101
|
+
if (evalEligible) {
|
|
3102
3102
|
try {
|
|
3103
|
-
const
|
|
3104
|
-
if (!
|
|
3103
|
+
const evalRun = evalRunOf(source, opts.modules, opts.inject);
|
|
3104
|
+
if (!evalRun) {
|
|
3105
3105
|
} else if (fnName.includes(".")) {
|
|
3106
3106
|
const [clsName, methodName] = fnName.split(".", 2);
|
|
3107
|
-
const clsAbs =
|
|
3107
|
+
const clsAbs = evalRun[clsName ?? ""];
|
|
3108
3108
|
if (clsAbs && typeof clsAbs === "object" && "shape" in clsAbs) {
|
|
3109
3109
|
const nCtor = ctorParamCountOf(fileAst, clsName ?? "");
|
|
3110
3110
|
const inst = $new(clsAbs, Array.from({ length: nCtor }, () => abs({ k: "any" }, void 0, pTrue, "path")));
|
|
3111
3111
|
result = withExecPhi(phi, () => $invoke(inst, methodName ?? "", args));
|
|
3112
3112
|
}
|
|
3113
|
-
} else if (fnName in
|
|
3114
|
-
const
|
|
3113
|
+
} else if (fnName in evalRun) {
|
|
3114
|
+
const evalArgs = args.map((a, i) => {
|
|
3115
3115
|
const shape2 = promoteScan.promotedShapes.get(params[i]);
|
|
3116
3116
|
if (shape2 && (a.shape.k === "any" || a.shape.k === "unknown")) {
|
|
3117
3117
|
return { shape: shape2, term: a.term, pred: a.pred, conf: "path" };
|
|
3118
3118
|
}
|
|
3119
3119
|
return a;
|
|
3120
3120
|
});
|
|
3121
|
-
result = callTranspiledExportFull(
|
|
3121
|
+
result = callTranspiledExportFull(evalRun, fnName, evalArgs, { phi }).result;
|
|
3122
3122
|
}
|
|
3123
3123
|
} catch {
|
|
3124
3124
|
}
|
|
@@ -4029,17 +4029,17 @@ function scanLiteralCalls(source, knownFns, phi, opts) {
|
|
|
4029
4029
|
const resolve = collectCallResolvers(source, knownFns, opts);
|
|
4030
4030
|
const forwards = collectForwarders(source, knownSet, resolve, file);
|
|
4031
4031
|
const varAbs = opts?.varAbs ?? /* @__PURE__ */ new Map();
|
|
4032
|
-
const
|
|
4032
|
+
const evalCallIndex = /* @__PURE__ */ new Map();
|
|
4033
4033
|
for (const r of opts?.bCalls ?? []) {
|
|
4034
4034
|
if (!r.callLoc) continue;
|
|
4035
4035
|
const key = `${r.fnName}\0${r.callLoc.line}`;
|
|
4036
|
-
const list =
|
|
4036
|
+
const list = evalCallIndex.get(key) ?? [];
|
|
4037
4037
|
list.push(r.args);
|
|
4038
|
-
|
|
4038
|
+
evalCallIndex.set(key, list);
|
|
4039
4039
|
}
|
|
4040
4040
|
const takeBCallArgs = (fnName, line) => {
|
|
4041
4041
|
if (line === void 0) return void 0;
|
|
4042
|
-
const list =
|
|
4042
|
+
const list = evalCallIndex.get(`${fnName}\0${line}`);
|
|
4043
4043
|
if (!list || list.length === 0) return void 0;
|
|
4044
4044
|
return list.shift();
|
|
4045
4045
|
};
|
|
@@ -4632,10 +4632,10 @@ function scanLiteralCalls(source, knownFns, phi, opts) {
|
|
|
4632
4632
|
let absArgs = parsed.absArgs;
|
|
4633
4633
|
let hasInfo = parsed.hasInfo;
|
|
4634
4634
|
if (!hasInfo) {
|
|
4635
|
-
const
|
|
4636
|
-
if (
|
|
4637
|
-
absArgs =
|
|
4638
|
-
hasInfo =
|
|
4635
|
+
const evalArgs = takeBCallArgs(fnName, loc?.start.line);
|
|
4636
|
+
if (evalArgs && evalArgs.length > 0) {
|
|
4637
|
+
absArgs = evalArgs;
|
|
4638
|
+
hasInfo = evalArgs.some(isInformativeArg);
|
|
4639
4639
|
}
|
|
4640
4640
|
}
|
|
4641
4641
|
if (!hasInfo || absArgs.length === 0) return;
|
|
@@ -4698,10 +4698,10 @@ function scanLiteralCalls(source, knownFns, phi, opts) {
|
|
|
4698
4698
|
let absArgs = parsedExt.absArgs;
|
|
4699
4699
|
let hasInfo = parsedExt.hasInfo;
|
|
4700
4700
|
if (!hasInfo) {
|
|
4701
|
-
const
|
|
4702
|
-
if (
|
|
4703
|
-
absArgs =
|
|
4704
|
-
hasInfo =
|
|
4701
|
+
const evalArgs = takeBCallArgs(ext.fnName, loc?.start.line);
|
|
4702
|
+
if (evalArgs && evalArgs.length > 0) {
|
|
4703
|
+
absArgs = evalArgs;
|
|
4704
|
+
hasInfo = evalArgs.some(isInformativeArg);
|
|
4705
4705
|
}
|
|
4706
4706
|
}
|
|
4707
4707
|
if (!hasInfo || absArgs.length === 0) return;
|
package/dist/exec.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { $ as $add, a as $arguments, b as $arr, c as $arrMutContainer, d as $arrRest, e as $arrWithHoles, f as $assignRecord, g as $async, h as $asyncReturn, i as $await, j as $bitand, k as $bitnot, l as $bitor, m as $bitxor, n as $call, o as $callNamed, p as $catchVal, q as $class, r as $classExpr, s as $collectionForEach, t as $concat, u as $copy, v as $del, w as $delRes, x as $div, y as $dynamicImport, z as $elems, B as $eq, C as $eqLoose, D as $fnVal, E as $for, F as $forInKeys, G as $forIter, H as $forOf, I as $fork, J as $ge, K as $gen, L as $get, M as $gt, N as $idx, O as $idxSet, P as $importMeta, Q as $in, S as $instanceof, T as $instanceofNonIdent, U as $invoke, V as $invokeSuper, W as $isBreakTo, X as $isForkExit, Y as $join, Z as $le, _ as $len, a0 as $lit, a1 as $loopBreak, a2 as $loopContinue, a3 as $loopReturn, a4 as $lt, a5 as $mod, a6 as $mul, a7 as $ne, a8 as $neLoose, a9 as $neg, aa as $new, ab as $not, ac as $nullishTest, ad as $obj, ae as $objAccessor, af as $objRest, ag as $optionalGet, ah as $optionalInvoke, ai as $orDefault, aj as $pow, ak as $pushLoopExit, al as $rawThis, am as $reStateCall, an as $recordBinding, ao as $regex, ap as $rethrowIfNudoReturn, aq as $set, ar as $setKey, as as $shl, at as $shr, au as $spread, av as $staticInvoke, aw as $sub, ax as $super, ay as $switch, az as $thisGet, aA as $thisSet, aB as $throw, aC as $toNumber, aD as $
|
|
2
|
-
import './hof-types-
|
|
1
|
+
export { $ as $add, a as $arguments, b as $arr, c as $arrMutContainer, d as $arrRest, e as $arrWithHoles, f as $assignRecord, g as $async, h as $asyncReturn, i as $await, j as $bitand, k as $bitnot, l as $bitor, m as $bitxor, n as $call, o as $callNamed, p as $catchVal, q as $class, r as $classExpr, s as $collectionForEach, t as $concat, u as $copy, v as $del, w as $delRes, x as $div, y as $dynamicImport, z as $elems, B as $eq, C as $eqLoose, D as $fnVal, E as $for, F as $forInKeys, G as $forIter, H as $forOf, I as $fork, J as $ge, K as $gen, L as $get, M as $gt, N as $idx, O as $idxSet, P as $importMeta, Q as $in, S as $instanceof, T as $instanceofNonIdent, U as $invoke, V as $invokeSuper, W as $isBreakTo, X as $isForkExit, Y as $join, Z as $le, _ as $len, a0 as $lit, a1 as $loopBreak, a2 as $loopContinue, a3 as $loopReturn, a4 as $lt, a5 as $mod, a6 as $mul, a7 as $ne, a8 as $neLoose, a9 as $neg, aa as $new, ab as $not, ac as $nullishTest, ad as $obj, ae as $objAccessor, af as $objRest, ag as $optionalGet, ah as $optionalInvoke, ai as $orDefault, aj as $pow, ak as $pushLoopExit, al as $rawThis, am as $reStateCall, an as $recordBinding, ao as $regex, ap as $rethrowIfNudoReturn, aq as $set, ar as $setKey, bV as $setProto, as as $shl, at as $shr, au as $spread, av as $staticInvoke, aw as $sub, ax as $super, ay as $switch, az as $thisGet, aA as $thisSet, aB as $throw, aC as $toNumber, aD as $toNumeric, aE as $tryCurrentMark, aF as $tryDetachSoftCatch, aG as $tryDigestSoftCatch, aH as $tryDiscardSoft, aI as $tryMark, aJ as $tryOrphanSoft, aK as $tryPopMark, aL as $tryReleaseSoftCatch, aM as $tryReleaseSoftOut, aN as $tryTakeSince, aO as $typeof, aP as $unknown, aQ as $updateAdd, aR as $updateSub, aS as $ushr, aT as $while, aU as $whileSeq, aV as $yield, aW as DEFAULT_MAX_LOOP_ITERS, aX as EvalAbsAssignRecord, aY as EvalCallRecord, aZ as EvalClassSpec, a_ as EvalFallback, a$ as MAX_EVAL_CALL_DEPTH, b0 as MAX_EVAL_TOTAL_CALLS, b1 as NudoLoopSignal, b2 as NudoReturn, b3 as NudoThrow, b4 as NudoUnsupportedError, b5 as RUNTIME_IMPORT_RE, R as RunTranspiledOptions, b6 as TranspileOptions, b7 as TranspiledCallResult, b8 as asAbsVal, ba as bindingsOf, bb as callAtFunctionBoundary, bc as callTranspiledExport, bd as callTranspiledExportFull, be as clearBClasses, bf as clearStaleTermPred, bh as currentExecPhi, bi as evalExprAbs, bj as fillTuple, bk as foldRequireSpecArg, bl as foldStaticStringExpr, bm as getEvalCallCollector, bn as getEvalClass, bo as isArrMutator, bp as isDefinitelyFalse, bq as isDefinitelyTrue, br as isNudoBreak, bs as isNudoContinue, bt as isNudoReturn, bu as isNudoThrow, bv as litTruth, bw as lookupObjAccessor, bx as namespaceNameOf, by as noteEvalCallRecord, bz as noteEvalFallback, bA as pushLoopExit, bB as pushThrowExit, bC as registerEvalClass, bD as resetEvalCallBudget, bE as runTranspiled, bF as runTranspiledOptionsMemoKey, bG as runWithLoopExits, bH as runtimeImportOf, bI as setEvalAssignCollector, bJ as setEvalBindingSink, bK as setEvalCallCollector, bL as setEvalFallbackCollector, bM as takeLoopExits, bN as takeThrowExits, bO as transpile, bP as transpileBodyNode, bQ as transpileExpression, bR as transpileFile, bS as transpileSource, bT as tryRunTranspiled, bU as withExecPhi } from './index-BNiZvVHw.js';
|
|
2
|
+
import './hof-types-DqDpAxfh.js';
|
|
3
3
|
import '@babel/types';
|
package/dist/exec.js
CHANGED
|
@@ -80,6 +80,7 @@ import {
|
|
|
80
80
|
$rethrowIfNudoReturn,
|
|
81
81
|
$set,
|
|
82
82
|
$setKey,
|
|
83
|
+
$setProto,
|
|
83
84
|
$shl,
|
|
84
85
|
$shr,
|
|
85
86
|
$spread,
|
|
@@ -91,6 +92,7 @@ import {
|
|
|
91
92
|
$thisSet,
|
|
92
93
|
$throw,
|
|
93
94
|
$toNumber,
|
|
95
|
+
$toNumeric,
|
|
94
96
|
$tryCurrentMark,
|
|
95
97
|
$tryDetachSoftCatch,
|
|
96
98
|
$tryDigestSoftCatch,
|
|
@@ -103,13 +105,15 @@ import {
|
|
|
103
105
|
$tryTakeSince,
|
|
104
106
|
$typeof,
|
|
105
107
|
$unknown,
|
|
108
|
+
$updateAdd,
|
|
109
|
+
$updateSub,
|
|
106
110
|
$ushr,
|
|
107
111
|
$while,
|
|
108
112
|
$whileSeq,
|
|
109
113
|
$yield,
|
|
110
114
|
DEFAULT_MAX_LOOP_ITERS,
|
|
111
|
-
|
|
112
|
-
|
|
115
|
+
MAX_EVAL_CALL_DEPTH,
|
|
116
|
+
MAX_EVAL_TOTAL_CALLS,
|
|
113
117
|
NudoLoopSignal,
|
|
114
118
|
NudoReturn,
|
|
115
119
|
NudoThrow,
|
|
@@ -127,8 +131,8 @@ import {
|
|
|
127
131
|
fillTuple,
|
|
128
132
|
foldRequireSpecArg,
|
|
129
133
|
foldStaticStringExpr,
|
|
130
|
-
|
|
131
|
-
|
|
134
|
+
getEvalCallCollector,
|
|
135
|
+
getEvalClass,
|
|
132
136
|
isArrMutator,
|
|
133
137
|
isDefinitelyFalse,
|
|
134
138
|
isDefinitelyTrue,
|
|
@@ -139,20 +143,20 @@ import {
|
|
|
139
143
|
litTruth,
|
|
140
144
|
lookupObjAccessor,
|
|
141
145
|
namespaceNameOf,
|
|
142
|
-
|
|
143
|
-
|
|
146
|
+
noteEvalCallRecord,
|
|
147
|
+
noteEvalFallback,
|
|
144
148
|
pushLoopExit,
|
|
145
149
|
pushThrowExit,
|
|
146
|
-
|
|
147
|
-
|
|
150
|
+
registerEvalClass,
|
|
151
|
+
resetEvalCallBudget,
|
|
148
152
|
runTranspiled,
|
|
149
153
|
runTranspiledOptionsMemoKey,
|
|
150
154
|
runWithLoopExits,
|
|
151
155
|
runtimeImportOf,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
+
setEvalAssignCollector,
|
|
157
|
+
setEvalBindingSink,
|
|
158
|
+
setEvalCallCollector,
|
|
159
|
+
setEvalFallbackCollector,
|
|
156
160
|
takeLoopExits,
|
|
157
161
|
takeThrowExits,
|
|
158
162
|
transpile,
|
|
@@ -162,7 +166,7 @@ import {
|
|
|
162
166
|
transpileSource,
|
|
163
167
|
tryRunTranspiled,
|
|
164
168
|
withExecPhi
|
|
165
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-4V3CRVSD.js";
|
|
166
170
|
export {
|
|
167
171
|
$add,
|
|
168
172
|
$arguments,
|
|
@@ -244,6 +248,7 @@ export {
|
|
|
244
248
|
$rethrowIfNudoReturn,
|
|
245
249
|
$set,
|
|
246
250
|
$setKey,
|
|
251
|
+
$setProto,
|
|
247
252
|
$shl,
|
|
248
253
|
$shr,
|
|
249
254
|
$spread,
|
|
@@ -255,6 +260,7 @@ export {
|
|
|
255
260
|
$thisSet,
|
|
256
261
|
$throw,
|
|
257
262
|
$toNumber,
|
|
263
|
+
$toNumeric,
|
|
258
264
|
$tryCurrentMark,
|
|
259
265
|
$tryDetachSoftCatch,
|
|
260
266
|
$tryDigestSoftCatch,
|
|
@@ -267,13 +273,15 @@ export {
|
|
|
267
273
|
$tryTakeSince,
|
|
268
274
|
$typeof,
|
|
269
275
|
$unknown,
|
|
276
|
+
$updateAdd,
|
|
277
|
+
$updateSub,
|
|
270
278
|
$ushr,
|
|
271
279
|
$while,
|
|
272
280
|
$whileSeq,
|
|
273
281
|
$yield,
|
|
274
282
|
DEFAULT_MAX_LOOP_ITERS,
|
|
275
|
-
|
|
276
|
-
|
|
283
|
+
MAX_EVAL_CALL_DEPTH,
|
|
284
|
+
MAX_EVAL_TOTAL_CALLS,
|
|
277
285
|
NudoLoopSignal,
|
|
278
286
|
NudoReturn,
|
|
279
287
|
NudoThrow,
|
|
@@ -291,8 +299,8 @@ export {
|
|
|
291
299
|
fillTuple,
|
|
292
300
|
foldRequireSpecArg,
|
|
293
301
|
foldStaticStringExpr,
|
|
294
|
-
|
|
295
|
-
|
|
302
|
+
getEvalCallCollector,
|
|
303
|
+
getEvalClass,
|
|
296
304
|
isArrMutator,
|
|
297
305
|
isDefinitelyFalse,
|
|
298
306
|
isDefinitelyTrue,
|
|
@@ -303,20 +311,20 @@ export {
|
|
|
303
311
|
litTruth,
|
|
304
312
|
lookupObjAccessor,
|
|
305
313
|
namespaceNameOf,
|
|
306
|
-
|
|
307
|
-
|
|
314
|
+
noteEvalCallRecord,
|
|
315
|
+
noteEvalFallback,
|
|
308
316
|
pushLoopExit,
|
|
309
317
|
pushThrowExit,
|
|
310
|
-
|
|
311
|
-
|
|
318
|
+
registerEvalClass,
|
|
319
|
+
resetEvalCallBudget,
|
|
312
320
|
runTranspiled,
|
|
313
321
|
runTranspiledOptionsMemoKey,
|
|
314
322
|
runWithLoopExits,
|
|
315
323
|
runtimeImportOf,
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
324
|
+
setEvalAssignCollector,
|
|
325
|
+
setEvalBindingSink,
|
|
326
|
+
setEvalCallCollector,
|
|
327
|
+
setEvalFallbackCollector,
|
|
320
328
|
takeLoopExits,
|
|
321
329
|
takeThrowExits,
|
|
322
330
|
transpile,
|
|
@@ -88,6 +88,11 @@ declare function not(p: Pred): Pred;
|
|
|
88
88
|
* 逻辑否定(De Morgan):¬(A∧B)=¬A∨¬B;¬(A∨B)=¬A∧¬B;双重否定消去。
|
|
89
89
|
* typeof 否定展开为其余 TypeofName 标签的析取——8 标签域是 JS typeof 的
|
|
90
90
|
* 完整结果域,展开健全且相对完备。
|
|
91
|
+
*
|
|
92
|
+
* 关系比较(lt/le/gt/ge)的否定 **不是** 全序对偶:JS 里 NaN 参与时
|
|
93
|
+
* 全部关系为 false,故 ¬(x<5) 真而 x≥5 假。精确否定是 not(lt);
|
|
94
|
+
* 正向全序事实(Φ ⊢ x≥5 ⇒ x<5 为假)仍由 totalOrderDual 处理。
|
|
95
|
+
* eq↔ne 是精确否定,不受 NaN 影响。
|
|
91
96
|
*/
|
|
92
97
|
declare function negatePred(p: Pred): Pred;
|
|
93
98
|
declare function predEquals(a: Pred, b: Pred): boolean;
|
|
@@ -162,6 +167,15 @@ type Shape = {
|
|
|
162
167
|
name?: string;
|
|
163
168
|
paramTypes?: Abs[];
|
|
164
169
|
returnType?: Abs;
|
|
170
|
+
/**
|
|
171
|
+
* Dual-facet globals (Number/Array/…): callable AND carries static members.
|
|
172
|
+
* `$get` reads these before falling back to Function.prototype names.
|
|
173
|
+
*/
|
|
174
|
+
slots?: Record<string, {
|
|
175
|
+
value: Abs;
|
|
176
|
+
optional?: boolean;
|
|
177
|
+
readonly?: boolean;
|
|
178
|
+
}>;
|
|
165
179
|
} | {
|
|
166
180
|
k: "brand";
|
|
167
181
|
name: string;
|
|
@@ -254,11 +268,11 @@ declare function popMayThrowFrame(discard: boolean): MayThrowEffect[];
|
|
|
254
268
|
* 否则交给 collector。不得在栈非空时直接 flush,否则 outer catch 被旁路。
|
|
255
269
|
*/
|
|
256
270
|
declare function orphanMayThrowEffects(effects: MayThrowEffect[]): void;
|
|
257
|
-
/**
|
|
271
|
+
/** evaluator:try 开始时压 soft 帧 */
|
|
258
272
|
declare function $tryMarkSoft(): void;
|
|
259
|
-
/**
|
|
273
|
+
/** evaluator catch 消化 try 内 soft may-throw */
|
|
260
274
|
declare function $tryDigestSoft(): void;
|
|
261
|
-
/**
|
|
275
|
+
/** evaluator 无 handler / 出口 / rethrow:上浮未消化 soft may-throw(外层 try 可再消化) */
|
|
262
276
|
declare function $tryReleaseSoft(): MayThrowEffect[];
|
|
263
277
|
declare function flushMayThrowEffects(effects: MayThrowEffect[]): void;
|
|
264
278
|
declare function recordMayThrow(e: MayThrowEffect): void;
|