@nudojs/core 1.1.3 → 1.2.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/dist/{check-report-AtnAfY9U.d.ts → check-report-TEOZ4cPZ.d.ts} +1 -1
- package/dist/{chunk-T5VWMEJN.js → chunk-GD5XIQQK.js} +34 -34
- package/dist/{chunk-6DOKR7BM.js → chunk-WB565PQK.js} +246 -187
- package/dist/exec.d.ts +2 -2
- package/dist/exec.js +25 -25
- package/dist/{hof-types-tAeoYvzY.d.ts → hof-types-COqDeD5F.d.ts} +3 -3
- package/dist/{index-D4rnOHre.d.ts → index-DMjMPLV0.d.ts} +39 -39
- package/dist/index.d.ts +17 -17
- package/dist/index.js +48 -48
- package/dist/internal.d.ts +26 -26
- package/dist/internal.js +16 -16
- package/package.json +1 -1
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 $tryCurrentMark, aE as $tryDetachSoftCatch, aF as $tryDigestSoftCatch, aG as $tryDiscardSoft, aH as $tryMark, aI as $tryOrphanSoft, aJ as $tryPopMark, aK as $tryReleaseSoftCatch, aL as $tryReleaseSoftOut, aM as $tryTakeSince, aN as $typeof, aO as $unknown, aP as $ushr, aQ as $while, aR as $whileSeq, aS as $yield, aT 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, 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 $tryCurrentMark, aE as $tryDetachSoftCatch, aF as $tryDigestSoftCatch, aG as $tryDiscardSoft, aH as $tryMark, aI as $tryOrphanSoft, aJ as $tryPopMark, aK as $tryReleaseSoftCatch, aL as $tryReleaseSoftOut, aM as $tryTakeSince, aN as $typeof, aO as $unknown, aP as $ushr, aQ as $while, aR as $whileSeq, aS as $yield, aT as DEFAULT_MAX_LOOP_ITERS, aU as EvalAbsAssignRecord, aV as EvalCallRecord, aW as EvalClassSpec, aX as EvalFallback, aY as MAX_EVAL_CALL_DEPTH, aZ as MAX_EVAL_TOTAL_CALLS, a_ as NudoLoopSignal, a$ as NudoReturn, b0 as NudoThrow, b1 as NudoUnsupportedError, b2 as RUNTIME_IMPORT_RE, R as RunTranspiledOptions, b3 as TranspileOptions, b4 as TranspiledCallResult, b5 as asAbsVal, b7 as bindingsOf, b8 as callAtFunctionBoundary, b9 as callTranspiledExport, ba as callTranspiledExportFull, bb as clearBClasses, bc as clearStaleTermPred, be as currentExecPhi, bf as evalExprAbs, bg as fillTuple, bh as foldRequireSpecArg, bi as foldStaticStringExpr, bj as getEvalCallCollector, bk as getEvalClass, bl as isArrMutator, bm as isDefinitelyFalse, bn as isDefinitelyTrue, bo as isNudoBreak, bp as isNudoContinue, bq as isNudoReturn, br as isNudoThrow, bs as litTruth, bt as lookupObjAccessor, bu as namespaceNameOf, bv as noteEvalCallRecord, bw as noteEvalFallback, bx as pushLoopExit, by as pushThrowExit, bz as registerEvalClass, bA as resetEvalCallBudget, bB as runTranspiled, bC as runTranspiledOptionsMemoKey, bD as runWithLoopExits, bE as runtimeImportOf, bF as setEvalAssignCollector, bG as setEvalBindingSink, bH as setEvalCallCollector, bI as setEvalFallbackCollector, bJ as takeLoopExits, bK as takeThrowExits, bL as transpile, bM as transpileBodyNode, bN as transpileExpression, bO as transpileFile, bP as transpileSource, bQ as tryRunTranspiled, bR as withExecPhi } from './index-DMjMPLV0.js';
|
|
2
|
+
import './hof-types-COqDeD5F.js';
|
|
3
3
|
import '@babel/types';
|
package/dist/exec.js
CHANGED
|
@@ -108,8 +108,8 @@ import {
|
|
|
108
108
|
$whileSeq,
|
|
109
109
|
$yield,
|
|
110
110
|
DEFAULT_MAX_LOOP_ITERS,
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
MAX_EVAL_CALL_DEPTH,
|
|
112
|
+
MAX_EVAL_TOTAL_CALLS,
|
|
113
113
|
NudoLoopSignal,
|
|
114
114
|
NudoReturn,
|
|
115
115
|
NudoThrow,
|
|
@@ -127,8 +127,8 @@ import {
|
|
|
127
127
|
fillTuple,
|
|
128
128
|
foldRequireSpecArg,
|
|
129
129
|
foldStaticStringExpr,
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
getEvalCallCollector,
|
|
131
|
+
getEvalClass,
|
|
132
132
|
isArrMutator,
|
|
133
133
|
isDefinitelyFalse,
|
|
134
134
|
isDefinitelyTrue,
|
|
@@ -139,20 +139,20 @@ import {
|
|
|
139
139
|
litTruth,
|
|
140
140
|
lookupObjAccessor,
|
|
141
141
|
namespaceNameOf,
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
noteEvalCallRecord,
|
|
143
|
+
noteEvalFallback,
|
|
144
144
|
pushLoopExit,
|
|
145
145
|
pushThrowExit,
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
registerEvalClass,
|
|
147
|
+
resetEvalCallBudget,
|
|
148
148
|
runTranspiled,
|
|
149
149
|
runTranspiledOptionsMemoKey,
|
|
150
150
|
runWithLoopExits,
|
|
151
151
|
runtimeImportOf,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
152
|
+
setEvalAssignCollector,
|
|
153
|
+
setEvalBindingSink,
|
|
154
|
+
setEvalCallCollector,
|
|
155
|
+
setEvalFallbackCollector,
|
|
156
156
|
takeLoopExits,
|
|
157
157
|
takeThrowExits,
|
|
158
158
|
transpile,
|
|
@@ -162,7 +162,7 @@ import {
|
|
|
162
162
|
transpileSource,
|
|
163
163
|
tryRunTranspiled,
|
|
164
164
|
withExecPhi
|
|
165
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-WB565PQK.js";
|
|
166
166
|
export {
|
|
167
167
|
$add,
|
|
168
168
|
$arguments,
|
|
@@ -272,8 +272,8 @@ export {
|
|
|
272
272
|
$whileSeq,
|
|
273
273
|
$yield,
|
|
274
274
|
DEFAULT_MAX_LOOP_ITERS,
|
|
275
|
-
|
|
276
|
-
|
|
275
|
+
MAX_EVAL_CALL_DEPTH,
|
|
276
|
+
MAX_EVAL_TOTAL_CALLS,
|
|
277
277
|
NudoLoopSignal,
|
|
278
278
|
NudoReturn,
|
|
279
279
|
NudoThrow,
|
|
@@ -291,8 +291,8 @@ export {
|
|
|
291
291
|
fillTuple,
|
|
292
292
|
foldRequireSpecArg,
|
|
293
293
|
foldStaticStringExpr,
|
|
294
|
-
|
|
295
|
-
|
|
294
|
+
getEvalCallCollector,
|
|
295
|
+
getEvalClass,
|
|
296
296
|
isArrMutator,
|
|
297
297
|
isDefinitelyFalse,
|
|
298
298
|
isDefinitelyTrue,
|
|
@@ -303,20 +303,20 @@ export {
|
|
|
303
303
|
litTruth,
|
|
304
304
|
lookupObjAccessor,
|
|
305
305
|
namespaceNameOf,
|
|
306
|
-
|
|
307
|
-
|
|
306
|
+
noteEvalCallRecord,
|
|
307
|
+
noteEvalFallback,
|
|
308
308
|
pushLoopExit,
|
|
309
309
|
pushThrowExit,
|
|
310
|
-
|
|
311
|
-
|
|
310
|
+
registerEvalClass,
|
|
311
|
+
resetEvalCallBudget,
|
|
312
312
|
runTranspiled,
|
|
313
313
|
runTranspiledOptionsMemoKey,
|
|
314
314
|
runWithLoopExits,
|
|
315
315
|
runtimeImportOf,
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
316
|
+
setEvalAssignCollector,
|
|
317
|
+
setEvalBindingSink,
|
|
318
|
+
setEvalCallCollector,
|
|
319
|
+
setEvalFallbackCollector,
|
|
320
320
|
takeLoopExits,
|
|
321
321
|
takeThrowExits,
|
|
322
322
|
transpile,
|
|
@@ -254,11 +254,11 @@ declare function popMayThrowFrame(discard: boolean): MayThrowEffect[];
|
|
|
254
254
|
* 否则交给 collector。不得在栈非空时直接 flush,否则 outer catch 被旁路。
|
|
255
255
|
*/
|
|
256
256
|
declare function orphanMayThrowEffects(effects: MayThrowEffect[]): void;
|
|
257
|
-
/**
|
|
257
|
+
/** evaluator:try 开始时压 soft 帧 */
|
|
258
258
|
declare function $tryMarkSoft(): void;
|
|
259
|
-
/**
|
|
259
|
+
/** evaluator catch 消化 try 内 soft may-throw */
|
|
260
260
|
declare function $tryDigestSoft(): void;
|
|
261
|
-
/**
|
|
261
|
+
/** evaluator 无 handler / 出口 / rethrow:上浮未消化 soft may-throw(外层 try 可再消化) */
|
|
262
262
|
declare function $tryReleaseSoft(): MayThrowEffect[];
|
|
263
263
|
declare function flushMayThrowEffects(effects: MayThrowEffect[]): void;
|
|
264
264
|
declare function recordMayThrow(e: MayThrowEffect): void;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { A as Abs, M as MayThrowEffect, b as Phi, c as AstEnv } from './hof-types-
|
|
1
|
+
import { A as Abs, M as MayThrowEffect, b as Phi, c as AstEnv } from './hof-types-COqDeD5F.js';
|
|
2
2
|
import * as _babel_types from '@babel/types';
|
|
3
3
|
import { Node, Expression, File, ImportDeclaration } from '@babel/types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* 求值引擎 throw 载荷(独立叶子模块):
|
|
7
7
|
* builtins.ts(evalJsonMethod 等 Abs builtin)需要硬抛 TypeError/SyntaxError,
|
|
8
8
|
* 而 exec/runtime.ts 又 import builtins.ts(evalNamespaceCall 等)——
|
|
9
9
|
* 直接互引成环。NudoThrow 无依赖(仅 Abs 类型 + Error),抽成叶子,
|
|
10
10
|
* runtime.ts re-export 保持既有 import 面不变。
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
/**
|
|
13
|
+
/** 求值引擎 throw 载荷:携带 Abs 抛出值 */
|
|
14
14
|
declare class NudoThrow extends Error {
|
|
15
15
|
readonly absValue: Abs;
|
|
16
16
|
constructor(absValue: Abs);
|
|
@@ -18,7 +18,7 @@ declare class NudoThrow extends Error {
|
|
|
18
18
|
declare function isNudoThrow(e: unknown): e is NudoThrow;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* 求值引擎运行时共享状态:phi、就地写、字面量 Abs、真值、循环信号。
|
|
22
22
|
* 叶子模块——不依赖 runtime 其它文件(tuple/obj 字面量就地构造,避免 state↔containers 环)。
|
|
23
23
|
*/
|
|
24
24
|
|
|
@@ -28,7 +28,7 @@ declare function currentExecPhi(): Phi;
|
|
|
28
28
|
declare function withExecPhi<T>(p: Phi, body: () => T): T;
|
|
29
29
|
/**
|
|
30
30
|
* transpile 泄漏的 JS 函数值 → 一等 fn Abs。
|
|
31
|
-
*
|
|
31
|
+
* 求值引擎把函数声明/表达式编译成真实 JS 函数;它们流进对象槽、
|
|
32
32
|
* 元组、join 等 Abs 结构时不能裸存——下游(bridge/leq/join)读 `.shape`。
|
|
33
33
|
* 参数名无法从运行时函数恢复(用 fn.length → argN,与 analyzer 的
|
|
34
34
|
* extractParamNames 回退口径一致);带真实参数名走 $fnVal(transpile 侧)。
|
|
@@ -36,7 +36,7 @@ declare function withExecPhi<T>(p: Phi, body: () => T): T;
|
|
|
36
36
|
declare function asAbsVal(v: unknown): Abs;
|
|
37
37
|
/**
|
|
38
38
|
* 函数调用边界:callee 的 loop/early-return 不得冒泡成 caller 结果。
|
|
39
|
-
* 每个
|
|
39
|
+
* 每个 求值引擎调用帧独立 ALS;NudoReturn 收成该调用的返回值。
|
|
40
40
|
*/
|
|
41
41
|
declare function callAtFunctionBoundary<T>(body: () => T): T;
|
|
42
42
|
/** 函数表达式 → 一等 fn Abs(transpile 侧带真实参数名;异步 body 包 $async)
|
|
@@ -47,7 +47,7 @@ declare function $fnVal(params: string[], impl: (...args: Abs[]) => Abs, opts?:
|
|
|
47
47
|
/**
|
|
48
48
|
* 宿主 this → Abs:函数体 prologue 用它承接 call/apply/bind 传入的 thisArg。
|
|
49
49
|
* Abs 原样返回;宿主 undefined(普通调用/call 缺 thisArg)→ $lit(undefined)。
|
|
50
|
-
*
|
|
50
|
+
* 求值引擎产物是 new Function 拼接(sloppy),裸调用的宿主 this 泄漏为
|
|
51
51
|
* globalThis——归一到 $lit(undefined)(strict 模块语义下的 this)。
|
|
52
52
|
*/
|
|
53
53
|
declare function $rawThis(v: unknown): Abs;
|
|
@@ -91,7 +91,7 @@ declare function $tryDiscardSoft(_effects: MayThrowEffect[]): void;
|
|
|
91
91
|
declare function $tryOrphanSoft(effects: MayThrowEffect[]): void;
|
|
92
92
|
/** 无 handler / 出口:上浮未消化 soft may-throw(幂等) */
|
|
93
93
|
declare function $tryReleaseSoftOut(): void;
|
|
94
|
-
/**
|
|
94
|
+
/** 求值引擎「函数提前 return」信号(区别于 throw) */
|
|
95
95
|
declare class NudoReturn extends Error {
|
|
96
96
|
readonly absValue: Abs;
|
|
97
97
|
constructor(absValue: Abs);
|
|
@@ -343,7 +343,7 @@ declare function $get(o: Abs, key: string, opts?: {
|
|
|
343
343
|
}): Abs;
|
|
344
344
|
/**
|
|
345
345
|
* Map/Set forEach:条目表逐条调用回调(value, key, recv)。
|
|
346
|
-
* 回调是
|
|
346
|
+
* 回调是 求值引擎 JS 函数(transpile 内联箭头)直接调用;Abs fn 走 $call。
|
|
347
347
|
* 回调返回值丢弃;forEach 表达式值恒 undefined。
|
|
348
348
|
*/
|
|
349
349
|
declare function $collectionForEach(recv: Abs, cb: unknown): Abs | undefined;
|
|
@@ -457,7 +457,7 @@ declare function transpileBodyNode(node: Node, opts: TranspileOptions): string;
|
|
|
457
457
|
declare function transpileExpression(expr: Expression, opts?: TranspileOptions): string;
|
|
458
458
|
|
|
459
459
|
/**
|
|
460
|
-
*
|
|
460
|
+
* 求值引擎 transpile:JS AST → 可在 Node 上执行的抽象值程序(源码字符串)。
|
|
461
461
|
* 运算符改为 $add/$sub/…;if 改为 $fork;for 改为 $for。
|
|
462
462
|
* 值类型是 Abs;副作用与模块仍由 host mock/注入。
|
|
463
463
|
*
|
|
@@ -474,7 +474,7 @@ declare function transpile(source: string, opts?: TranspileOptions): string;
|
|
|
474
474
|
|
|
475
475
|
/**
|
|
476
476
|
* 调用 Abs 一等函数(absFunction impl)或 mock apply。
|
|
477
|
-
* 供
|
|
477
|
+
* 供 求值引擎 import 绑定包装:`(...args) => $call(absFn, args)`。
|
|
478
478
|
*
|
|
479
479
|
* 统一顺序:apply → body → relation → isRelFn(委托 applyAbsFn)。
|
|
480
480
|
* 行为对齐说明(与旧 $call 的差异,均属刻意):
|
|
@@ -490,11 +490,11 @@ declare function $call(fn: Abs, args: Abs[], thisVal?: Abs): Abs;
|
|
|
490
490
|
* Abs-eval registerClassDecl 与 transpile $class 共用。
|
|
491
491
|
*/
|
|
492
492
|
|
|
493
|
-
type
|
|
493
|
+
type EvalClassAccessor = {
|
|
494
494
|
get?: (thisVal: Abs) => Abs;
|
|
495
495
|
set?: (thisVal: Abs, v: Abs) => Abs;
|
|
496
496
|
};
|
|
497
|
-
type
|
|
497
|
+
type EvalClassSpec = {
|
|
498
498
|
name: string;
|
|
499
499
|
superName?: string;
|
|
500
500
|
ctor?: (thisVal: Abs, ...args: Abs[]) => Abs;
|
|
@@ -506,12 +506,12 @@ type BClassSpec = {
|
|
|
506
506
|
staticMethodParams?: Record<string, string[]>;
|
|
507
507
|
statics?: Record<string, Abs>;
|
|
508
508
|
/** 实例 get/set:get 无参返回 Abs;set 收到 (thisVal, v) 返回更新后的 thisVal */
|
|
509
|
-
accessors?: Record<string,
|
|
509
|
+
accessors?: Record<string, EvalClassAccessor>;
|
|
510
510
|
/** 静态 get/set:挂在类构造器上,不在实例原型链 */
|
|
511
|
-
staticAccessors?: Record<string,
|
|
511
|
+
staticAccessors?: Record<string, EvalClassAccessor>;
|
|
512
512
|
};
|
|
513
|
-
declare function
|
|
514
|
-
declare function
|
|
513
|
+
declare function registerEvalClass(spec: EvalClassSpec): void;
|
|
514
|
+
declare function getEvalClass(name: string): EvalClassSpec | undefined;
|
|
515
515
|
declare function clearBClasses(): void;
|
|
516
516
|
|
|
517
517
|
/**
|
|
@@ -526,12 +526,12 @@ declare function clearBClasses(): void;
|
|
|
526
526
|
declare function $reStateCall(re: Abs, method: string, args: Abs[]): Abs;
|
|
527
527
|
|
|
528
528
|
/**
|
|
529
|
-
*
|
|
529
|
+
* 求值引擎 class:brand 实例 + ctor/method 闭包 + 继承链。
|
|
530
530
|
* 方法内 this 由 transpile 改写为 thisVal 参数。
|
|
531
531
|
*/
|
|
532
532
|
|
|
533
533
|
/** 定义类 → 可 new 的 Abs(brand 标记;静态字段挂在 slots) */
|
|
534
|
-
declare function $class(name: string, spec: Omit<
|
|
534
|
+
declare function $class(name: string, spec: Omit<EvalClassSpec, "name"> & {
|
|
535
535
|
extends?: string | Abs | unknown;
|
|
536
536
|
}): Abs;
|
|
537
537
|
/** new C(...) → 空 brand 实例 + ctor 写字段;非类构造走 impl/$call */
|
|
@@ -560,12 +560,12 @@ declare function $staticInvoke(cls: Abs, method: string, args: Abs[]): Abs;
|
|
|
560
560
|
declare function $setKey(o: Abs, key: Abs, value: Abs): Abs;
|
|
561
561
|
|
|
562
562
|
/**
|
|
563
|
-
*
|
|
563
|
+
* 求值引擎调用点记录:transpile 把 `f(args)` 改成 $callNamed,
|
|
564
564
|
* 分析时可收集 call@ 所需的 AbsCallRecord。
|
|
565
565
|
* 成员缺失诊断见 member-diag.ts(共用,避免循环依赖)。
|
|
566
566
|
*/
|
|
567
567
|
|
|
568
|
-
type
|
|
568
|
+
type EvalCallRecord = {
|
|
569
569
|
fnName: string;
|
|
570
570
|
args: Abs[];
|
|
571
571
|
result: Abs;
|
|
@@ -576,7 +576,7 @@ type BCallRecord = {
|
|
|
576
576
|
threw?: boolean;
|
|
577
577
|
};
|
|
578
578
|
/** B 赋值记录(与 ast-records.ts AbsAssignRecord 同形;structuralAssignIssues 消费) */
|
|
579
|
-
type
|
|
579
|
+
type EvalAbsAssignRecord = {
|
|
580
580
|
name: string;
|
|
581
581
|
prev: Abs | undefined;
|
|
582
582
|
next: Abs;
|
|
@@ -585,29 +585,29 @@ type BAbsAssignRecord = {
|
|
|
585
585
|
conditional?: boolean;
|
|
586
586
|
};
|
|
587
587
|
/** 返回先前 collector,便于嵌套调用 save/restore(禁止 finally 置 null 砸外层) */
|
|
588
|
-
declare function
|
|
588
|
+
declare function setEvalAssignCollector(collector: ((r: EvalAbsAssignRecord) => void) | null): ((r: EvalAbsAssignRecord) => void) | null;
|
|
589
589
|
/** 结构赋值记录(transpile 插桩调用;无收集器时 no-op) */
|
|
590
590
|
declare function $assignRecord(name: string, prev: Abs | undefined, next: Abs, line: number, column: number, conditional: boolean): void;
|
|
591
|
-
declare function
|
|
591
|
+
declare function setEvalBindingSink(sink: Map<string, unknown> | null): void;
|
|
592
592
|
/** 顶层绑定记录(transpile 插桩调用) */
|
|
593
593
|
declare function $recordBinding(name: string, value: unknown): void;
|
|
594
594
|
/** 返回先前 collector,便于嵌套调用 save/restore(禁止 finally 置 null 砸外层) */
|
|
595
595
|
/** 成员/方法调用点打点($invoke 等;无收集器时 no-op)。不进 $callNamed 预算。 */
|
|
596
|
-
declare function
|
|
597
|
-
declare function
|
|
598
|
-
declare function
|
|
596
|
+
declare function noteEvalCallRecord(r: EvalCallRecord): void;
|
|
597
|
+
declare function setEvalCallCollector(collector: ((r: EvalCallRecord) => void) | null): ((r: EvalCallRecord) => void) | null;
|
|
598
|
+
declare function getEvalCallCollector(): ((r: EvalCallRecord) => void) | null;
|
|
599
599
|
/**
|
|
600
600
|
* 按名调用并记录。
|
|
601
601
|
* loc: [line, column](1-based line,0-based column,与 Babel 一致)
|
|
602
602
|
* argLocs: 与 args 对齐的实参字面量源位置(provenance;无 loc 用 null)
|
|
603
603
|
*/
|
|
604
|
-
declare const
|
|
604
|
+
declare const MAX_EVAL_CALL_DEPTH = 64;
|
|
605
605
|
/** 总调用上限:与 call-budget.MAX_TOTAL_CALLS 同阀(递归×循环×分支展开的
|
|
606
606
|
* 规模阀)。200k 在病态展开(lodash _baseFlatten)下 ~30s,20k 收口到
|
|
607
607
|
* ~3s——截断 → opaque(更保守,zero-FP 安全)。 */
|
|
608
|
-
declare const
|
|
608
|
+
declare const MAX_EVAL_TOTAL_CALLS = 20000;
|
|
609
609
|
/** 宿主入口(runTranspiled / callTranspiledExportFull)前重置 */
|
|
610
|
-
declare function
|
|
610
|
+
declare function resetEvalCallBudget(): void;
|
|
611
611
|
declare function $callNamed(name: string, fn: unknown, args: Abs[], loc?: [number, number], argLocs?: Array<[number, number] | null | undefined>): Abs;
|
|
612
612
|
|
|
613
613
|
/**
|
|
@@ -667,11 +667,11 @@ declare function runTranspiledOptionsMemoKey(opts: RunTranspiledOptions | undefi
|
|
|
667
667
|
declare const RUNTIME_IMPORT_RE: RegExp;
|
|
668
668
|
declare function bindingsOf(run: Record<string, unknown>): Map<string, unknown> | undefined;
|
|
669
669
|
/**
|
|
670
|
-
* 执行一段
|
|
670
|
+
* 执行一段 求值引擎程序,返回顶层 `export function` / `export const`。
|
|
671
671
|
*/
|
|
672
672
|
declare function runTranspiled(source: string, opts?: RunTranspiledOptions): Record<string, unknown>;
|
|
673
|
-
/**
|
|
674
|
-
type
|
|
673
|
+
/** evaluator 回落事件(观测单一埋点;reason: unsupported:* = 能力边界,internal = 引擎自身缺陷) */
|
|
674
|
+
type EvalFallback = {
|
|
675
675
|
reason: string;
|
|
676
676
|
message: string;
|
|
677
677
|
loc?: {
|
|
@@ -679,13 +679,13 @@ type BPathFallback = {
|
|
|
679
679
|
column: number;
|
|
680
680
|
};
|
|
681
681
|
};
|
|
682
|
-
declare function
|
|
682
|
+
declare function setEvalFallbackCollector(collector: ((f: EvalFallback) => void) | null): void;
|
|
683
683
|
/** 表达式级求值(scan 的 case 字面量实参等静态求值面):编译单表达式经
|
|
684
|
-
*
|
|
684
|
+
* eval 运行时执行。bindings:表达式自由标识符 → Abs(调用方按绑定表注入)。
|
|
685
685
|
* 编译失败抛错(调用方按需 catch)。 */
|
|
686
686
|
declare function evalExprAbs(expr: _babel_types.Expression, bindings?: Record<string, Abs>): Abs;
|
|
687
687
|
/** 记录一次 B 回落(body-fn 等非 runTranspiled 入口共用) */
|
|
688
|
-
declare function
|
|
688
|
+
declare function noteEvalFallback(e: unknown): void;
|
|
689
689
|
/**
|
|
690
690
|
* B 单一入口:runTranspiled + 类型化回落观测。
|
|
691
691
|
* unsupported:*(能力边界)/ internal(B 缺陷)都记录到收集器;
|
|
@@ -698,7 +698,7 @@ type TranspiledCallResult = {
|
|
|
698
698
|
throws: Abs;
|
|
699
699
|
};
|
|
700
700
|
/** 调用 runTranspiled 导出(捕获 $throw)。opts.phi:入口 Φ 种子
|
|
701
|
-
* (instantiate/symbolic 的约束入口——
|
|
701
|
+
* (instantiate/symbolic 的约束入口——eval 侧路径条件收窄)。 */
|
|
702
702
|
declare function callTranspiledExportFull(exports: Record<string, unknown>, name: string, args: Abs[], opts?: {
|
|
703
703
|
phi?: Phi;
|
|
704
704
|
}): TranspiledCallResult;
|
|
@@ -709,7 +709,7 @@ declare function callTranspiledExport(exports: Record<string, unknown>, name: st
|
|
|
709
709
|
* 转译器无法正确 lowering 的构造:抛此错误(替代静默降级注释)。
|
|
710
710
|
* 消费方(tryRunTranspiled / body-fn)捕获后记录并 fail-closed
|
|
711
711
|
* 结构化回落理由(unsupported:*)——能力知识单一事实源在转译点,
|
|
712
|
-
* 不再依赖带外的
|
|
712
|
+
* 不再依赖带外的 isEvalCapable 清单。
|
|
713
713
|
*/
|
|
714
714
|
declare class NudoUnsupportedError extends Error {
|
|
715
715
|
readonly reason: string;
|
|
@@ -723,4 +723,4 @@ declare class NudoUnsupportedError extends Error {
|
|
|
723
723
|
});
|
|
724
724
|
}
|
|
725
725
|
|
|
726
|
-
export { $add as $, type AbsModuleExports as A, $eq as B, $eqLoose as C, $fnVal as D, $for as E, $forInKeys as F, $forIter as G, $forOf as H, $fork as I, $ge as J, $gen as K, $get as L, $gt as M, $idx as N, $idxSet as O, $importMeta as P, $in as Q, type RunTranspiledOptions as R, $instanceof as S, $instanceofNonIdent as T, $invoke as U, $invokeSuper as V, $isBreakTo as W, $isForkExit as X, $join as Y, $le as Z, $len as _, $arguments as a, NudoReturn as a$, $lit as a0, $loopBreak as a1, $loopContinue as a2, $loopReturn as a3, $lt as a4, $mod as a5, $mul as a6, $ne as a7, $neLoose as a8, $neg as a9, $thisSet as aA, $throw as aB, $toNumber as aC, $tryCurrentMark as aD, $tryDetachSoftCatch as aE, $tryDigestSoftCatch as aF, $tryDiscardSoft as aG, $tryMark as aH, $tryOrphanSoft as aI, $tryPopMark as aJ, $tryReleaseSoftCatch as aK, $tryReleaseSoftOut as aL, $tryTakeSince as aM, $typeof as aN, $unknown as aO, $ushr as aP, $while as aQ, $whileSeq as aR, $yield as aS,
|
|
726
|
+
export { $add as $, type AbsModuleExports as A, $eq as B, $eqLoose as C, $fnVal as D, $for as E, $forInKeys as F, $forIter as G, $forOf as H, $fork as I, $ge as J, $gen as K, $get as L, $gt as M, $idx as N, $idxSet as O, $importMeta as P, $in as Q, type RunTranspiledOptions as R, $instanceof as S, $instanceofNonIdent as T, $invoke as U, $invokeSuper as V, $isBreakTo as W, $isForkExit as X, $join as Y, $le as Z, $len as _, $arguments as a, NudoReturn as a$, $lit as a0, $loopBreak as a1, $loopContinue as a2, $loopReturn as a3, $lt as a4, $mod as a5, $mul as a6, $ne as a7, $neLoose as a8, $neg as a9, $thisSet as aA, $throw as aB, $toNumber as aC, $tryCurrentMark as aD, $tryDetachSoftCatch as aE, $tryDigestSoftCatch as aF, $tryDiscardSoft as aG, $tryMark as aH, $tryOrphanSoft as aI, $tryPopMark as aJ, $tryReleaseSoftCatch as aK, $tryReleaseSoftOut as aL, $tryTakeSince as aM, $typeof as aN, $unknown as aO, $ushr as aP, $while as aQ, $whileSeq as aR, $yield as aS, DEFAULT_MAX_LOOP_ITERS as aT, type EvalAbsAssignRecord as aU, type EvalCallRecord as aV, type EvalClassSpec as aW, type EvalFallback as aX, MAX_EVAL_CALL_DEPTH as aY, MAX_EVAL_TOTAL_CALLS as aZ, NudoLoopSignal as a_, $new as aa, $not as ab, $nullishTest as ac, $obj as ad, $objAccessor as ae, $objRest as af, $optionalGet as ag, $optionalInvoke as ah, $orDefault as ai, $pow as aj, $pushLoopExit as ak, $rawThis as al, $reStateCall as am, $recordBinding as an, $regex as ao, $rethrowIfNudoReturn as ap, $set as aq, $setKey as ar, $shl as as, $shr as at, $spread as au, $staticInvoke as av, $sub as aw, $super as ax, $switch as ay, $thisGet as az, $arr as b, NudoThrow as b0, NudoUnsupportedError as b1, RUNTIME_IMPORT_RE as b2, type TranspileOptions as b3, type TranspiledCallResult as b4, asAbsVal as b5, bindImports as b6, bindingsOf as b7, callAtFunctionBoundary as b8, callTranspiledExport as b9, resetEvalCallBudget as bA, runTranspiled as bB, runTranspiledOptionsMemoKey as bC, runWithLoopExits as bD, runtimeImportOf as bE, setEvalAssignCollector as bF, setEvalBindingSink as bG, setEvalCallCollector as bH, setEvalFallbackCollector as bI, takeLoopExits as bJ, takeThrowExits as bK, transpile as bL, transpileBodyNode as bM, transpileExpression as bN, transpileFile as bO, transpileSource as bP, tryRunTranspiled as bQ, withExecPhi as bR, callTranspiledExportFull as ba, clearBClasses as bb, clearStaleTermPred as bc, collectAbsExports as bd, currentExecPhi as be, evalExprAbs as bf, fillTuple as bg, foldRequireSpecArg as bh, foldStaticStringExpr as bi, getEvalCallCollector as bj, getEvalClass as bk, isArrMutator as bl, isDefinitelyFalse as bm, isDefinitelyTrue as bn, isNudoBreak as bo, isNudoContinue as bp, isNudoReturn as bq, isNudoThrow as br, litTruth as bs, lookupObjAccessor as bt, namespaceNameOf as bu, noteEvalCallRecord as bv, noteEvalFallback as bw, pushLoopExit as bx, pushThrowExit as by, registerEvalClass as bz, $arrMutContainer as c, $arrRest as d, $arrWithHoles as e, $assignRecord as f, $async as g, $asyncReturn as h, $await as i, $bitand as j, $bitnot as k, $bitor as l, $bitxor as m, $call as n, $callNamed as o, $catchVal as p, $class as q, $classExpr as r, $collectionForEach as s, $concat as t, $copy as u, $del as v, $delRes as w, $div as x, $dynamicImport as y, $elems as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { c as AstEnv, A as Abs, b as Phi, C as Confidence, T as Term, H as HofCollectCtx, S as Shape, a as Pred, R as RelSource, w as HofSite } from './hof-types-
|
|
2
|
-
export { I as ImplicationOracle, L as LiteralValue, P as PrimName, x as TYPEOF_NAMES, y as TypeofName, z as abs, B as absToString, D as and, F as anyAbs, G as anyVar, J as app, K as bigintLit, N as bool, O as boolLit, Q as confJoin, U as emptyPhi, V as eq, W as ge, X as geNum, Y as getImplicationOracle, Z as gt, _ as gtNum, a0 as implies, a1 as isBigPrim, a2 as isExactLit, a3 as isNumPrim, a4 as isStrPrim, a5 as le, a6 as leNum, a7 as lit, a8 as litValue, a9 as lt, aa as ltNum, ab as ne, ac as negatePred, ad as never, ae as not, af as num, ag as numLit, ah as numVar, ai as obj, aj as or, ak as pFalse, al as pTrue, am as phiAnd, an as predEquals, ao as predToString, ap as predVars, aq as primToTypeof, ar as ptypeof, as as setImplicationOracle, at as shapeOfTerm, au as shapeToString, av as simplifyTerm, aw as str, ax as strLit, ay as substPred, az as termEquals, aA as termToString, aB as unknown, aC as v } from './hof-types-
|
|
1
|
+
import { c as AstEnv, A as Abs, b as Phi, C as Confidence, T as Term, H as HofCollectCtx, S as Shape, a as Pred, R as RelSource, w as HofSite } from './hof-types-COqDeD5F.js';
|
|
2
|
+
export { I as ImplicationOracle, L as LiteralValue, P as PrimName, x as TYPEOF_NAMES, y as TypeofName, z as abs, B as absToString, D as and, F as anyAbs, G as anyVar, J as app, K as bigintLit, N as bool, O as boolLit, Q as confJoin, U as emptyPhi, V as eq, W as ge, X as geNum, Y as getImplicationOracle, Z as gt, _ as gtNum, a0 as implies, a1 as isBigPrim, a2 as isExactLit, a3 as isNumPrim, a4 as isStrPrim, a5 as le, a6 as leNum, a7 as lit, a8 as litValue, a9 as lt, aa as ltNum, ab as ne, ac as negatePred, ad as never, ae as not, af as num, ag as numLit, ah as numVar, ai as obj, aj as or, ak as pFalse, al as pTrue, am as phiAnd, an as predEquals, ao as predToString, ap as predVars, aq as primToTypeof, ar as ptypeof, as as setImplicationOracle, at as shapeOfTerm, au as shapeToString, av as simplifyTerm, aw as str, ax as strLit, ay as substPred, az as termEquals, aA as termToString, aB as unknown, aC as v } from './hof-types-COqDeD5F.js';
|
|
3
3
|
import { Node } from '@babel/types';
|
|
4
|
-
import { p as parseSource, L as LeakBudget, E as EffectiveInterfaceOpts, b as LoadDepsFingerprint, i as CheckReport, N as NudoConstraint } from './check-report-
|
|
5
|
-
export { j as CheckAction, C as CheckIssue, k as CheckJson, o as CheckJsonMulti, q as ConstraintBuilder, D as Diagnostic, u as EffectiveInterface, G as GitlabCodeQualityIssue, v as InterfaceDiag, I as InterfaceSource, w as InterfaceTierInfo, a as InterfaceTierOpts, x as NamedImport, y as NudoField, z as NudoFnConstraint, A as NudoSidecarError, B as NudoSig, R as RefineDiag, F as RefineEntry, H as RefineResolveOpts, S as SELF, J as actionsForIssue, K as andC, M as any, O as array, P as boolean, Q as checkArg, T as checkCall, U as constraintToEntryAbs, V as effectiveInterface, W as execNudoModule, X as extractDeclaredThrows, Y as extractNudoImports, Z as extractRefineReturnFromSource, _ as extractRefinesFromSource, $ as fn, a0 as fnConstraintToEntryReqs, a1 as formatCheckReport, a2 as formatConstraint, a3 as formatDiagnostics, a4 as formatEffectiveInterfaceDisplay, a5 as formatGithubAnnotations, a6 as formatGitlabCodeQuality, a7 as formatInterfaceTierLine, a8 as generatedExportNames, a9 as getParseSourceCacheSize, aa as getTerm, ab as instantiateConstraint, ac as interfaceDiagCount, ad as interfaceSourceOf, ae as interfaceTierOf, af as isIntFlag, ag as isNodeModulesPath, ah as isNudoConstraint, ai as lenTerm, aj as litC, ak as localNamedExports, al as number, am as omit, an as partial, ao as pick, ap as refineDiagCount, aq as refineToIndexedFull, ar as resetNudoModuleExecCache, as as resetParseSourceCache, at as serializeCheckJson, au as serializeCheckJsonMulti, av as setInterfaceDiagCollector, aw as setRefineDiagCollector, ax as shape, ay as sidecarClosureFingerprint, az as sidecarPathOf, aA as string, aB as takeInterfaceDiags, aC as takeInterfaceDiagsSince, aD as takeRefineDiags, aE as takeRefineDiagsSince, aF as throwConstraintToKinds, aG as union } from './check-report-
|
|
6
|
-
import { A as AbsModuleExports, R as RunTranspiledOptions } from './index-
|
|
7
|
-
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 $tryCurrentMark, aE as $tryDetachSoftCatch, aF as $tryDigestSoftCatch, aG as $tryDiscardSoft, aH as $tryMark, aI as $tryOrphanSoft, aJ as $tryPopMark, aK as $tryReleaseSoftCatch, aL as $tryReleaseSoftOut, aM as $tryTakeSince, aN as $typeof, aO as $unknown, aP as $ushr, aQ as $while, aR as $whileSeq, aS as $yield, aT as
|
|
4
|
+
import { p as parseSource, L as LeakBudget, E as EffectiveInterfaceOpts, b as LoadDepsFingerprint, i as CheckReport, N as NudoConstraint } from './check-report-TEOZ4cPZ.js';
|
|
5
|
+
export { j as CheckAction, C as CheckIssue, k as CheckJson, o as CheckJsonMulti, q as ConstraintBuilder, D as Diagnostic, u as EffectiveInterface, G as GitlabCodeQualityIssue, v as InterfaceDiag, I as InterfaceSource, w as InterfaceTierInfo, a as InterfaceTierOpts, x as NamedImport, y as NudoField, z as NudoFnConstraint, A as NudoSidecarError, B as NudoSig, R as RefineDiag, F as RefineEntry, H as RefineResolveOpts, S as SELF, J as actionsForIssue, K as andC, M as any, O as array, P as boolean, Q as checkArg, T as checkCall, U as constraintToEntryAbs, V as effectiveInterface, W as execNudoModule, X as extractDeclaredThrows, Y as extractNudoImports, Z as extractRefineReturnFromSource, _ as extractRefinesFromSource, $ as fn, a0 as fnConstraintToEntryReqs, a1 as formatCheckReport, a2 as formatConstraint, a3 as formatDiagnostics, a4 as formatEffectiveInterfaceDisplay, a5 as formatGithubAnnotations, a6 as formatGitlabCodeQuality, a7 as formatInterfaceTierLine, a8 as generatedExportNames, a9 as getParseSourceCacheSize, aa as getTerm, ab as instantiateConstraint, ac as interfaceDiagCount, ad as interfaceSourceOf, ae as interfaceTierOf, af as isIntFlag, ag as isNodeModulesPath, ah as isNudoConstraint, ai as lenTerm, aj as litC, ak as localNamedExports, al as number, am as omit, an as partial, ao as pick, ap as refineDiagCount, aq as refineToIndexedFull, ar as resetNudoModuleExecCache, as as resetParseSourceCache, at as serializeCheckJson, au as serializeCheckJsonMulti, av as setInterfaceDiagCollector, aw as setRefineDiagCollector, ax as shape, ay as sidecarClosureFingerprint, az as sidecarPathOf, aA as string, aB as takeInterfaceDiags, aC as takeInterfaceDiagsSince, aD as takeRefineDiags, aE as takeRefineDiagsSince, aF as throwConstraintToKinds, aG as union } from './check-report-TEOZ4cPZ.js';
|
|
6
|
+
import { A as AbsModuleExports, R as RunTranspiledOptions } from './index-DMjMPLV0.js';
|
|
7
|
+
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 $tryCurrentMark, aE as $tryDetachSoftCatch, aF as $tryDigestSoftCatch, aG as $tryDiscardSoft, aH as $tryMark, aI as $tryOrphanSoft, aJ as $tryPopMark, aK as $tryReleaseSoftCatch, aL as $tryReleaseSoftOut, aM as $tryTakeSince, aN as $typeof, aO as $unknown, aP as $ushr, aQ as $while, aR as $whileSeq, aS as $yield, aT as DEFAULT_MAX_LOOP_ITERS, aU as EvalAbsAssignRecord, aV as EvalCallRecord, aW as EvalClassSpec, aX as EvalFallback, aY as MAX_EVAL_CALL_DEPTH, aZ as MAX_EVAL_TOTAL_CALLS, a_ as NudoLoopSignal, a$ as NudoReturn, b0 as NudoThrow, b1 as NudoUnsupportedError, b2 as RUNTIME_IMPORT_RE, b3 as TranspileOptions, b4 as TranspiledCallResult, b5 as asAbsVal, b6 as bindImports, b7 as bindingsOf, b8 as callAtFunctionBoundary, b9 as callTranspiledExport, ba as callTranspiledExportFull, bb as clearBClasses, bc as clearStaleTermPred, bd as collectAbsExports, be as currentExecPhi, bf as evalExprAbs, bg as fillTuple, bh as foldRequireSpecArg, bi as foldStaticStringExpr, bj as getEvalCallCollector, bk as getEvalClass, bl as isArrMutator, bm as isDefinitelyFalse, bn as isDefinitelyTrue, bo as isNudoBreak, bp as isNudoContinue, bq as isNudoReturn, br as isNudoThrow, bs as litTruth, bt as lookupObjAccessor, bu as namespaceNameOf, bv as noteEvalCallRecord, bw as noteEvalFallback, bx as pushLoopExit, by as pushThrowExit, bz as registerEvalClass, bA as resetEvalCallBudget, bB as runTranspiled, bC as runTranspiledOptionsMemoKey, bD as runWithLoopExits, bE as runtimeImportOf, bF as setEvalAssignCollector, bG as setEvalBindingSink, bH as setEvalCallCollector, bI as setEvalFallbackCollector, bJ as takeLoopExits, bK as takeThrowExits, bL as transpile, bM as transpileBodyNode, bN as transpileExpression, bO as transpileFile, bP as transpileSource, bQ as tryRunTranspiled, bR as withExecPhi } from './index-DMjMPLV0.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* AstEnv:抽象求值环境类型面(ast-eval 删除后保留)。
|
|
11
11
|
* 类型定义在 hof-types.ts(打破 ast-env ↔ hof ↔ abs-fn 类型环);
|
|
12
12
|
* 本文件保留空环境 / withVar 的便捷构造并重导出 AstEnv 供稳定路径导入。
|
|
13
|
-
* 仍被
|
|
13
|
+
* 仍被 求值引擎 check / leq / generalize / builtins 消费。
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
/** 空求值环境(分析宿主用:不带任何绑定) */
|
|
@@ -113,7 +113,7 @@ declare function describePhi(): string;
|
|
|
113
113
|
* 与 term-registry 同一纪律:不给共享单例挂 impl。
|
|
114
114
|
*/
|
|
115
115
|
|
|
116
|
-
/** Abs 原生 env/builtin 实现(
|
|
116
|
+
/** Abs 原生 env/builtin 实现(evaluator 优先) */
|
|
117
117
|
type AbsSigImpl = (args: Abs[], thisVal?: Abs) => Abs | undefined;
|
|
118
118
|
type AbsFnImpl = {
|
|
119
119
|
params: string[];
|
|
@@ -250,7 +250,7 @@ declare function tryPromoteDirectCall(env: AstEnv, calleeName: string, args: Abs
|
|
|
250
250
|
* 按方法名提升:map/flatMap → fn([αOf(el)], B:param);filter → fn([αOf(el)], bool);
|
|
251
251
|
* reduce → fn([αOf(init), αOf(el)], B:param)。
|
|
252
252
|
*/
|
|
253
|
-
declare function tryPromoteHofCallback(env: AstEnv,
|
|
253
|
+
declare function tryPromoteHofCallback(env: AstEnv, cevalName: string, method: string, argAbses: Abs[], loc?: {
|
|
254
254
|
line: number;
|
|
255
255
|
column: number;
|
|
256
256
|
}): Abs | undefined;
|
|
@@ -297,7 +297,7 @@ declare function instantiateReturn(fn: Abs, args: Abs[]): Abs;
|
|
|
297
297
|
*
|
|
298
298
|
* 为避免 hof ↔ exec 循环依赖,本函数由宿主在运行时绑定。
|
|
299
299
|
*
|
|
300
|
-
* 依赖说明:宿主在 `exec/call.ts`(
|
|
300
|
+
* 依赖说明:宿主在 `exec/call.ts`(evaluator `$call` 宿主)加载时注册(副作用)。
|
|
301
301
|
* 只 import hof.ts 而未加载 exec/call 时,fallback 仅认 relation/isRelFn。
|
|
302
302
|
* 与 §5.1 的「禁止全局 collector」不同——这里是无状态委托钩子,不是 run 局部状态。
|
|
303
303
|
*/
|
|
@@ -305,7 +305,7 @@ type ApplyCallbackHost = (cb: Abs | {
|
|
|
305
305
|
type: string;
|
|
306
306
|
}, args: Abs[], env: unknown, phi: unknown, budget: unknown) => Abs;
|
|
307
307
|
/**
|
|
308
|
-
*
|
|
308
|
+
* evaluator 宿主 `exec/call.ts` 加载时注册(副作用)。
|
|
309
309
|
* 必须经 `exec/call.ts`(或其依赖方:exec/class、generalize)加载,
|
|
310
310
|
* 才能启用 Identifier/env.fns/inline body 路径;只 import hof.ts 时 fallback
|
|
311
311
|
* 仅认 relation/isRelFn。勿在多份实例下各写各的——双包/双副本会覆盖。
|
|
@@ -314,7 +314,7 @@ declare function setApplyCallbackHost(fn: ApplyCallbackHost): void;
|
|
|
314
314
|
/**
|
|
315
315
|
* 通用回调实参调用(exec/class invokeArrMethod 与 builtins Array.from 共用):
|
|
316
316
|
* 原始 JS 函数直调(展开实参);Abs fn 走 applyCallbackAbs(sum 分发/宿主)。
|
|
317
|
-
*
|
|
317
|
+
* 求值引擎 transpile 的箭头回调是 $fnVal Abs——$fnVal.apply 自带调用边界。
|
|
318
318
|
*/
|
|
319
319
|
declare function applyCallbackValue(fn: unknown, args: Abs[], env: unknown, phi: unknown, budget: unknown): Abs;
|
|
320
320
|
declare function applyCallbackAbs(cb: Abs | {
|
|
@@ -510,7 +510,7 @@ declare function evalDateMethod(name: string, _recv: Abs, _args: Abs[]): Abs | u
|
|
|
510
510
|
*/
|
|
511
511
|
|
|
512
512
|
declare function evalRegExpCtor(args: Abs[]): Abs;
|
|
513
|
-
/** RegExp brand:source/flags/lastIndex 进 slots(
|
|
513
|
+
/** RegExp brand:source/flags/lastIndex 进 slots(evaluator evalRegExpCtor / $regex 共用) */
|
|
514
514
|
declare function regexBrandAbsFrom(pattern: string, flags: string): Abs;
|
|
515
515
|
/**
|
|
516
516
|
* new RegExp(pattern, flags) 字面量真构造验证($new 与 evalRegExpCtor 共用):
|
|
@@ -635,7 +635,7 @@ declare function stringOfSymbol(a: Abs): Abs;
|
|
|
635
635
|
*/
|
|
636
636
|
|
|
637
637
|
/**
|
|
638
|
-
* Object.prototype 方法语义(
|
|
638
|
+
* Object.prototype 方法语义(evaluator $invoke 与 Object.prototype.X.call 共用)。
|
|
639
639
|
* null-proto 接收者无这些方法——返回 undefined(调用方走 TypeError 路径)。
|
|
640
640
|
* 返回 undefined = 未接管。
|
|
641
641
|
*/
|
|
@@ -852,11 +852,11 @@ declare function leqAbs(src: Abs, tgt: Abs, opts?: {
|
|
|
852
852
|
|
|
853
853
|
/**
|
|
854
854
|
* Abs 域记录类型面(ast-eval 执行器删除后保留)。
|
|
855
|
-
* 运行时记录由
|
|
855
|
+
* 运行时记录由 eval 通道(EvalCallRecord/$assignRecord)产生;此处的类型是
|
|
856
856
|
* checkSource drift / 结构赋值诊断的共享形状,仍被 check.ts 等消费。
|
|
857
857
|
*/
|
|
858
858
|
|
|
859
|
-
/** Abs 域调用记录(
|
|
859
|
+
/** Abs 域调用记录(eval 通道 EvalCallRecord 的同形投影) */
|
|
860
860
|
type AbsCallRecord = {
|
|
861
861
|
fnName: string;
|
|
862
862
|
args: Abs[];
|
|
@@ -867,7 +867,7 @@ type AbsCallRecord = {
|
|
|
867
867
|
};
|
|
868
868
|
threw?: boolean;
|
|
869
869
|
};
|
|
870
|
-
/** Abs 域赋值记录(
|
|
870
|
+
/** Abs 域赋值记录(eval 通道 $assignRecord 的同形投影) */
|
|
871
871
|
type AbsAssignRecord = {
|
|
872
872
|
name: string;
|
|
873
873
|
prev?: Abs;
|