@nudojs/core 1.14.0 → 1.15.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/exec.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as Abs, M as MayThrowEffect, b as Phi } from './run-DhSqP3in.js';
2
- export { W as $assignRecord, X as $call, Y as $callNamed, bI as $nodoPos, Z as $recordBinding, a5 as EvalAbsAssignRecord, a6 as EvalCallRecord, a7 as EvalFallback, g as EvalFallbackStats, a8 as EvalPosRecord, ab as MAX_EVAL_CALL_DEPTH, ac as MAX_EVAL_TOTAL_CALLS, ad as RUNTIME_IMPORT_RE, V as RunTranspiledOptions, af as TranspiledCallResult, at as bindingsOf, aw as callTranspiledExport, ax as callTranspiledExportApply, ay as callTranspiledExportFull, l as clearPureCallMemo, m as clearPureMemo, n as enterEvalCallBudgetSession, aD as evalExprAbs, p as exitEvalCallBudgetSession, v as getEvalCallBudgetState, aG as getEvalCallCollector, w as getEvalFallbackStats, bJ as getPosCollector, aO as isAbsVal, aQ as isCjsMainRun, b5 as noteEvalCallRecord, b6 as noteEvalFallback, bn as resetEvalCallBudget, H as resetEvalFallbackStats, bK as routeApplyThrows, bo as runTranspiled, bp as runTranspiledOptionsMemoKey, bq as setEvalAssignCollector, br as setEvalBindingSink, bs as setEvalCallCollector, bt as setEvalFallbackCollector, bv as setPosCollector, bF as tryRunTranspiled, O as withEvalBudgetOverride } from './run-DhSqP3in.js';
1
+ import { A as Abs, M as MayThrowEffect, b as Phi } from './run-DfloWX6i.js';
2
+ export { W as $assignRecord, X as $call, Y as $callNamed, bI as $nodoPos, Z as $recordBinding, a5 as EvalAbsAssignRecord, a6 as EvalCallRecord, a7 as EvalFallback, g as EvalFallbackStats, a8 as EvalPosRecord, ab as MAX_EVAL_CALL_DEPTH, ac as MAX_EVAL_TOTAL_CALLS, ad as RUNTIME_IMPORT_RE, V as RunTranspiledOptions, af as TranspiledCallResult, at as bindingsOf, aw as callTranspiledExport, ax as callTranspiledExportApply, ay as callTranspiledExportFull, l as clearPureCallMemo, m as clearPureMemo, n as enterEvalCallBudgetSession, aD as evalExprAbs, p as exitEvalCallBudgetSession, v as getEvalCallBudgetState, aG as getEvalCallCollector, w as getEvalFallbackStats, bJ as getPosCollector, aO as isAbsVal, aQ as isCjsMainRun, b5 as noteEvalCallRecord, b6 as noteEvalFallback, bn as resetEvalCallBudget, H as resetEvalFallbackStats, bK as routeApplyThrows, bo as runTranspiled, bp as runTranspiledOptionsMemoKey, bq as setEvalAssignCollector, br as setEvalBindingSink, bs as setEvalCallCollector, bt as setEvalFallbackCollector, bv as setPosCollector, bF as tryRunTranspiled, O as withEvalBudgetOverride } from './run-DfloWX6i.js';
3
3
  import { Node, Expression, File } from '@babel/types';
4
4
 
5
5
  /**
@@ -308,7 +308,53 @@ declare function $isForkExit(e: unknown): boolean;
308
308
  declare function $catchVal(e: unknown): Abs;
309
309
 
310
310
  /**
311
- * 数组 / 对象运行时:$arr/$idx/$len/$arrMutContainer 与 $obj/$get/$set/$spread。
311
+ * 对象构造/展开/rest 与容器快照:$obj/$setProto/$spread/$objRest/$copy。
312
+ *
313
+ * Invariants:
314
+ * - $copy 是 fork/switch/循环 pack 的状态分离机制:所有可挂侧表的形状
315
+ * (extState/propFlags/accessorTable/nullProto/matchIter)必须随快照
316
+ * 迁移,副本丢失侧表 = 臂内写不再硬抛 / 延迟异常静默丢弃。
317
+ * - $spread 原生语义会**调用**源对象 getter 并把结果拷为数据槽——必须
318
+ * 用 getter 求值后的副本(accessorTable 求值,抛/失败折 unknown)。
319
+ */
320
+
321
+ /**
322
+ * 深拷贝可变容器(fork/switch 快照与循环 pack 用)。
323
+ * 容器写就地进行后(引用语义),分析分支/迭代的状态分离必须靠拷贝——
324
+ * 浅引用快照会让臂间/迭代间互相污染。
325
+ */
326
+ declare function $copy(a: Abs): Abs;
327
+ /** 对象字面量 → Abs obj(槽位写走 setSlot,`__proto__` 不踩宿主 setter) */
328
+ declare function $obj(slots: Record<string, Abs>): Abs;
329
+ /**
330
+ * 对象字面量非计算 `__proto__: v` 的特殊原型设定(ES PropertyDefinition)。
331
+ * - v 为 null → null-proto(无 Object.prototype 回退)
332
+ * - v 为 object → 保守 open(继承读不折 exact undefined;细节不建模)
333
+ * - v 为 primitive → 原生忽略(无自有键、不改原型)
334
+ */
335
+ declare function $setProto(o: Abs, proto: Abs): Abs;
336
+ /** 对象展开 { ...a, b } */
337
+ declare function $spread(a: Abs, b: Abs): Abs;
338
+ /**
339
+ * 解构 rest:`const { a, ...rest } = o` → rest = o 去掉 named keys。
340
+ * closed obj:剩余槽 closed;open / optional 键:rest 仍 open(可能有未知键)。
341
+ */
342
+ declare function $objRest(o: Abs, keys: string[]): Abs;
343
+
344
+ /**
345
+ * 元组/数组构造与宽化。
346
+ *
347
+ * Invariants:
348
+ * - 容器策略单点:≤cap → tuple(逐元素精确);>cap → arr(元素 join)。
349
+ * cap 只约束字面量/拼接的类型面;生成器 drain 的 exact 权威序列越过
350
+ * cap 仍出 exact 元组(drainTupleOrWiden,TUPLE_MATERIALIZE_CAP 上界)。
351
+ * - arr.element 只描述**真实元素值域**——OOB undefined 是读位事实
352
+ * ($idx 抽象下标自行 join oobUndef marker),任何构造/宽化路径都
353
+ * 不得把 OOB undefined 烘焙进元素域(issue #156:烘焙会让「循环+push」
354
+ * 对任何元素契约不可证)。
355
+ * - 空 tuple 宽化只在零观测元素(interrupted 等整值宽化)时取 unknown
356
+ * 元素顶;正常增长路径元素域 = 全部观测元素域 join(joinAbs(unknown,E)
357
+ * 会吸收污染,空成员贡献空不贡献 unknown 顶)。
312
358
  */
313
359
 
314
360
  /** 数组字面量 → ≤cap tuple(逐元素精确)/ >cap arr;策略与 containers.ts 同源 */
@@ -327,12 +373,27 @@ declare function $arguments(items: ArrayLike<unknown>): Abs;
327
373
  * 超 cap 退化 arr 时丢弃 hole 精度(元素 join,长度语义已由 arr 承接)。
328
374
  */
329
375
  declare function $arrWithHoles(items: Abs[], holes: number[]): Abs;
330
- declare function isArrMutator(name: string): boolean;
331
376
  /**
332
377
  * rest 形参绑定(Bug 44):收集 namedCount 之后的实参包 $arr(长度保持
333
378
  * 原生——真调用面);唯一元素是符号注入哨兵时直通开放数组(签名面)。
334
379
  */
335
380
  declare function $restBind(list: ArrayLike<unknown>, namedCount: number): Abs;
381
+
382
+ /**
383
+ * 数组就地 mutator 族(push/unshift/pop/shift/splice/reverse/sort/
384
+ * copyWithin/fill)。
385
+ *
386
+ * Invariants:
387
+ * - 就地写回:shape/conf 替换但 Abs 身份不变(JS 引用语义——
388
+ * `const b = a; b.push(4)` 对 a 可见);旧 term/pred 不再描述新
389
+ * shape,一并清除(writeInPlace/clearStaleTermPred)。
390
+ * - 下标/边界实参经 ToIntegerOrInfinity:symbol/bigint 确定 TypeError;
391
+ * 抽象 → may(空接收者同样先校验);values 实参不校验(原生存储不转换)。
392
+ * - mutator 降 arr(splice 等)的元素域 = 全部观测元素 join——不并入
393
+ * OOB undefined(issue #156 元素域约定)。
394
+ */
395
+
396
+ declare function isArrMutator(name: string): boolean;
336
397
  declare function fillTuple(shape: {
337
398
  k: "tuple";
338
399
  elements: Abs[];
@@ -341,17 +402,26 @@ declare function fillTuple(shape: {
341
402
  k: "arr";
342
403
  element: Abs;
343
404
  }, vals: Abs[], arr: Abs): Abs;
344
- /**
345
- * 深拷贝可变容器(fork/switch 快照与循环 pack 用)。
346
- * 容器写就地进行后(引用语义),分析分支/迭代的状态分离必须靠拷贝——
347
- * 浅引用快照会让臂间/迭代间互相污染。
348
- */
349
- declare function $copy(a: Abs): Abs;
350
405
  /** 数组/元组方法(push/pop/shift/unshift/splice/reverse/sort/copyWithin/fill)
351
406
  * 的就地 mutator:Abs 身份不变(JS 引用语义——`const b = a; b.push(4)` 对 a
352
407
  * 可见)。$invoke 的 mutator 分支在**调用点**即刻执行本函数(表达式求值
353
408
  * 顺序正确,Bug 49/51),别名 / 成员槽 / Map 条目经共享 Abs 同步可见。 */
354
409
  declare function $arrMutContainer(arr: Abs, method: string, args: Abs[]): Abs;
410
+
411
+ /**
412
+ * 下标读写与长度:$idx/$idxSet/$len + abstractLen。
413
+ *
414
+ * Invariants:
415
+ * - 抽象下标可能 miss → 元素 ∪ oobUndef marker(越界是引擎精度产物,
416
+ * 下游嵌套读写不记 may-throw,issue #98);已知规范下标仍按元素投影
417
+ * (split()[0] 等非空序列链不断)。
418
+ * - arr 的具体下标读是**域分发**(xs[0]/xs[1] 同一 element Abs、不同
419
+ * 具体值)——markDomainShared 标记后 abstractLen 不 memo 共享 len#N
420
+ * (issue #175:否则 xs[0].length - xs[1].length 假折 0)。
421
+ * - abstractLen memo 只对**绑定接收者**合法(跨读同 term sound);
422
+ * lenVarSeq 单调递增,len#N term 全局唯一。
423
+ */
424
+
355
425
  /** 下标读 a[i];规范数组下标走精确投影,确定非下标键 → undefined,否则并所有元素;string[i] → 单字符 */
356
426
  declare function $idx(a: Abs, i: Abs, opts?: {
357
427
  silent?: boolean;
@@ -363,22 +433,21 @@ declare function $idxSet(a: Abs, i: Abs, value: Abs): Abs;
363
433
  declare function $len(a: Abs, opts?: {
364
434
  silent?: boolean;
365
435
  }): Abs;
366
- /** 对象字面量 → Abs obj(槽位写走 setSlot,`__proto__` 不踩宿主 setter) */
367
- declare function $obj(slots: Record<string, Abs>): Abs;
368
- /**
369
- * 对象字面量非计算 `__proto__: v` 的特殊原型设定(ES PropertyDefinition)。
370
- * - v 为 null → null-proto(无 Object.prototype 回退)
371
- * - v 为 object → 保守 open(继承读不折 exact undefined;细节不建模)
372
- * - v 为 primitive → 原生忽略(无自有键、不改原型)
373
- */
374
- declare function $setProto(o: Abs, proto: Abs): Abs;
375
- /** 对象展开 { ...a, b } */
376
- declare function $spread(a: Abs, b: Abs): Abs;
436
+
377
437
  /**
378
- * 解构 rest:`const { a, ...rest } = o` → rest = o 去掉 named keys。
379
- * closed obj:剩余槽 closed;open / optional 键:rest 仍 open(可能有未知键)。
438
+ * 迭代协议与 spread/rest 投影:$elems/$forOf/$concat/$arrRest/$iterCheck。
439
+ *
440
+ * Invariants:
441
+ * - brand 只是名义标签,结构面在内层(issue #147):内层 total → total;
442
+ * 否则 may——**绝不下 definite 非可迭代结论**(TypedArray/Buffer 等
443
+ * 内层空 obj,原型链 @@iterator 不在内层建模)。
444
+ * - 生成器/模板标签/matchAll 迭代物挂对象侧表:迭代 = 消费(从当前位
445
+ * 取剩余),体内延迟异常在消费点重放(不得静默截断成前缀,Bug 34)。
446
+ * - unbounded(长度未知)单代表迭代只跑一次:0 次/出口臂由 fork-arm +
447
+ * snapExit join 承接;break/continue 打断代表体 → widen.markInterrupted
448
+ * (完整迭代效应不可观测,累加器域整体宽化)。
380
449
  */
381
- declare function $objRest(o: Abs, keys: string[]): Abs;
450
+
382
451
  /** 数组 rest:`const [a, ...rest] = arr` → rest = 从 start 起的尾段 */
383
452
  declare function $arrRest(a: Abs, start: number): Abs;
384
453
  /** 数组连接 [...a, ...b] / [...a, x];结果超 cap 时与字面量同策略降 arr */
@@ -422,6 +491,28 @@ declare function $forOf(iterable: Abs, body: (item: Abs, index: Abs) => void, ma
422
491
  * 元素取抽象 unknown(原生由 next() 链驱动)。 */
423
492
  forAwait?: boolean;
424
493
  }): void;
494
+ /**
495
+ * Map/Set forEach:条目表逐条调用回调(value, key, recv)。
496
+ * 回调是 求值引擎 JS 函数(transpile 内联箭头)直接调用;Abs fn 走 $call。
497
+ * 回调返回值丢弃;forEach 表达式值恒 undefined。
498
+ */
499
+ declare function $collectionForEach(recv: Abs, cb: unknown): Abs | undefined;
500
+
501
+ /**
502
+ * 成员读写与派发:$get/$set + 命名空间身份路由 + 原型方法值读。
503
+ *
504
+ * Invariants:
505
+ * - protoMethodDispatch 是 `var`(非 let):exec/class 模块加载期经循环
506
+ * import 回调 setProtoMethodDispatch 时提升为 undefined 也安全(let
507
+ * 会 TDZ 崩加载序)。
508
+ * - 类方法一等值按(定义类 spec, kind, 键)驻留:同条目重复读返回同一
509
+ * Abs 引用(=== 折 true);跨 run last-wins 重注册换新 spec 对象,
510
+ * 驻留随旧 spec 回收失效。
511
+ * - 闭 shape 字面量 key miss → 精确 undefined(键确定不存在);open
512
+ * shape / 抽象键 → 并 unknown(键可能存在);已知原型访问器名槽面
513
+ * 未建模 → 诚实 unknown(不得 wrong-exact undefined)。
514
+ */
515
+
425
516
  declare function namespaceNameOf(v: unknown): string | undefined;
426
517
  /** 正则字面量 → RegExp brand(source/flags/lastIndex 进 slots,供 exec/test 精确执行) */
427
518
  declare function $regex(pattern: string, flags?: string): Abs;
@@ -429,12 +520,6 @@ declare function $regex(pattern: string, flags?: string): Abs;
429
520
  declare function $get(o: Abs, key: string, opts?: {
430
521
  silent?: boolean;
431
522
  }): Abs;
432
- /**
433
- * Map/Set forEach:条目表逐条调用回调(value, key, recv)。
434
- * 回调是 求值引擎 JS 函数(transpile 内联箭头)直接调用;Abs fn 走 $call。
435
- * 回调返回值丢弃;forEach 表达式值恒 undefined。
436
- */
437
- declare function $collectionForEach(recv: Abs, cb: unknown): Abs | undefined;
438
523
  /** 成员写:返回新 obj/brand(不可变更新);frozen/sealed/只读目标按 sloppy 静默失败。
439
524
  * opts.internal(Bug 84):私有字段落地——槽打 Slot.internal 标记;后续覆写
440
525
  * 保留既有标记(this.#x = v 不丢失 internal)。
@@ -702,13 +787,35 @@ declare function foldStaticStringExpr(node: unknown): string | undefined;
702
787
  declare function foldRequireSpecArg(arg: unknown): string | undefined;
703
788
 
704
789
  /**
705
- * 语句 / 块 / class 发射:transpileStatement、transpileBodyNode、transpileClass。
790
+ * 方法/函数体统一发射(stmt 按域拆分之一;语句 switch 在 ./statement.ts)。
791
+ *
792
+ * 不变量:
793
+ * - ObjectMethod / ClassMethod / 属性位 FunctionExpression 体必须走本入口
794
+ * (emitFnBlockBody / transpileFnBodyStmts)——逐语句 map(transpileStatement)
795
+ * 会绕过早退 if 提升,`if (c) return X; return Y` 的早退值被语句级 $fork
796
+ * thunk 吞掉(假精确);
797
+ * - 函数体边界 var 提升(Bug 21):skip = 参数模式名;嵌套块不传
798
+ * varScope(var 已在函数级提升,块内改发赋值);
799
+ * - P4b 参数遮蔽:继承 constNames 被本函数参数模式名遮蔽时扣除(假
800
+ * TypeError 是 wrong-definite);
801
+ * - generator/async 函数声明的 __nudoNonCtor 标记提升到语句列表顶部
802
+ * (Bug 9:先用后声明时 new g() 不误判)。
706
803
  */
707
804
 
708
805
  declare function transpileBodyNode(node: Node, opts: TranspileOptions): string;
709
806
 
710
807
  /**
711
- * 表达式发射:transpileExpression / transpileShortCircuitExpr。
808
+ * 表达式发射主分派(expr 按域拆分之一;各节点类别族在兄弟模块)。
809
+ *
810
+ * 不变量:
811
+ * - 入口顺序:@nudo:replace 替换 → ChainExpression 剥壳 → 可选链整链短路
812
+ * (./optional-chain.ts)→ Super 接收者 → 按节点类别族路由;未 lowering
813
+ * 的表达式统一 default unsupported(不得假精确 undefined);
814
+ * - positionRecordWrap 只包一次:内部递归一律经 transpileExpression 入口,
815
+ * 族模块回环经 transpile-dispatch 别名(emitTranspileExpression);
816
+ * - SSR 加载序陷阱:模块体尾部的 dispatch bind 是加载期副作用——必须直接
817
+ * import leaf(transpile-dispatch)与定义模块(./short-circuit.ts),不经
818
+ * facade/barrel 中转(vite SSR 下 barrel 再导出不是实例化期绑定)。
712
819
  */
713
820
 
714
821
  /**
@@ -814,19 +921,15 @@ declare function getEvalClass(name: string): EvalClassSpec | undefined;
814
921
  declare function clearBClasses(): void;
815
922
 
816
923
  /**
817
- * RegExp brand 执行面(leaf-ish):从 class.ts 拆出,避免巨型文件。
818
- */
819
-
820
- /**
821
- * 语句级 RegExp 状态写回(test/exec):执行并把 lastIndex 更新后的 brand
822
- * 返回给 transpile 重绑($reStateCall 与 $arrMutContainer 同模式)。
823
- * 表达式位置不写回($invoke 只读执行,调用方按 JS 语义先取值)。
824
- */
825
- declare function $reStateCall(re: Abs, method: string, args: Abs[]): Abs;
826
-
827
- /**
828
- * 求值引擎 class:brand 实例 + ctor/method 闭包 + 继承链。
829
- * 方法内 this 由 transpile 改写为 thisVal 参数。
924
+ * 类声明/注册/构造:$class/$new/$staticInit + registry 辅助。
925
+ *
926
+ * Invariants:
927
+ * - classImpl(WeakMap)是 spec 的唯一私有挂载点:Abs 对象身份 → 定义
928
+ * spec;同名类跨 run last-wins 重注册换新 spec(驻留侧表随旧 spec 回收)。
929
+ * - 实例字段就地突变(applyInstanceFields 落 inner obj 槽):原生引用共享
930
+ * 语义——方法内 this.x = v 对调用点持有的同一实例 Abs 可见。
931
+ * - new 的 ctor 帧走 pushCtorFrame/popCtorFrame;new.target 通道由
932
+ * withNewTargetReset 包裹(嵌套 new 不串帧)。
830
933
  */
831
934
 
832
935
  /** 定义类 → 可 new 的 Abs(brand 标记;静态字段挂在 slots) */
@@ -843,14 +946,22 @@ declare function $new(cls: Abs | ((...a: unknown[]) => unknown), args: Abs[]): A
843
946
  * 初始化);this 绑定类值;块内 throw 在定义点表面(NudoThrow 上浮)。
844
947
  */
845
948
  declare function $staticInit(cls: Abs, thunks: Array<(thisVal: Abs) => unknown>): void;
949
+
950
+ /**
951
+ * super 家族:$super/$invokeSuper/$getSuper/$setSuper + 对象超与静态超。
952
+ *
953
+ * Invariants:
954
+ * - super 解析沿注册表继承链(evalClassChain);链洞(未注册父名)→
955
+ * sound unknown(不得闭 obj miss 折 wrong-exact undefined)。
956
+ * - SUPER_PROTO_CHAIN_LIMIT 封顶 superProtoOf 递归(防原型环栈溢出)。
957
+ * - 宿主内建父构造器(superBuiltinHost 标记)才放行宿主静态通道。
958
+ */
959
+
846
960
  /**
847
961
  * super(...):父类构造写入字段(this 保持子类 brand)。
848
962
  * transpile: super(a,b) → __this = $super(__this, "Child", [a,b])
849
963
  */
850
964
  declare function $super(thisVal: Abs, childName: string, args: Abs[]): Abs;
851
-
852
- /** 实例方法调用:沿继承链;类 Abs 上回落 staticMethods;obj 上回落属性函数 */
853
- declare function $invoke(thisVal: Abs, method: string, args: Abs[], loc?: [number, number]): Abs;
854
965
  /** super.method():从父类起找(跳过自身覆盖) */
855
966
  declare function $invokeSuper(thisVal: Abs, childName: string, method: string, args: Abs[]): Abs;
856
967
  /** 类实例方法内 super.p / super[k] 属性读(Bug 14):父类原型链上的
@@ -882,6 +993,42 @@ declare function $getSuperObj(thisVal: Abs, key: Abs): Abs;
882
993
  * (运行时侧表)上找访问器 setter(以接收者调用);getter-only →
883
994
  * strict TypeError;数据槽/缺槽 → 原生折接收者自有写($set)。 */
884
995
  declare function $setSuperObj(thisVal: Abs, key: Abs, value: Abs): Abs;
996
+ /** 静态方法体内 super.m(args) / super[k](args)(R5):沿父类**静态**链查找
997
+ * (home = 类值,[[Prototype]] = 父构造器——Bug 18 链),以接收者类值
998
+ * 为 this 调用(原生 super.m() 的 this 是外围 this = 调用类,非父类)。 */
999
+ declare function $staticSuperInvoke(thisVal: Abs, childName: string, key: Abs, args: Abs[]): Abs;
1000
+ /** 静态方法体内 super.k = v(R5 / SetSuper 静态面):沿父类静态链找 setter
1001
+ * (以接收者类值调用);getter-only 挡链 → strict TypeError;数据字段/
1002
+ * 缺槽 → 原生折接收者自有数据属性(OrdinarySetWithOwnDescriptor:
1003
+ * CreateDataProperty on this = 调用类值,父类槽不动)。 */
1004
+ declare function $setSuperStatic(thisVal: Abs, childName: string, key: Abs, value: Abs): Abs;
1005
+
1006
+ /**
1007
+ * 调用派发总入口:$invoke(recv, method, args)。
1008
+ *
1009
+ * Invariants:
1010
+ * - protoMethodDispatch 注册语句在本模块体**加载期**执行且必须直连
1011
+ * containers/member.ts(不经 barrel——vite SSR 下 re-export 不是
1012
+ * 实例化期可用绑定;原单文件拓扑中 setter 是提升函数声明)。
1013
+ * - 数组方法(map/filter/reduce/…)委派 invokeArrMethod(invoke-arr.ts);
1014
+ * mutator 语句快路径在 transpile 层(emitArrMutatorRebinds),两条路径
1015
+ * 的元素域语义必须同口径(issue #153:SpreadElement 折 $unknown 的教训)。
1016
+ */
1017
+
1018
+ /** 实例方法调用:沿继承链;类 Abs 上回落 staticMethods;obj 上回落属性函数 */
1019
+ declare function $invoke(thisVal: Abs, method: string, args: Abs[], loc?: [number, number]): Abs;
1020
+
1021
+ /**
1022
+ * this/可选链/静态成员读写:$thisGet/$thisSet/$optionalGet/$staticInvoke/$setKey。
1023
+ *
1024
+ * Invariants:
1025
+ * - 类方法体内 this 成员读经 $thisGet(内层 obj 槽优先);可选链臂
1026
+ * (?.)已过 nullish 排除——不重复记 may-throw。
1027
+ * - $setKey 计算键写:非字面量 key → open + index join(不得写成字面
1028
+ * 槽 "?");对象字面量计算键 __proto__ 是自有数据属性(与 $set 的
1029
+ * setter 语义分流)。
1030
+ */
1031
+
885
1032
  declare function $thisGet(thisVal: Abs, key: string): Abs;
886
1033
  declare function $thisSet(thisVal: Abs, key: string, value: Abs): Abs;
887
1034
  /** 解构默认值:undefined(含 sum 成员 / 可能缺失)时用 default 并入非 undefined 部分 */
@@ -893,18 +1040,20 @@ declare function $optionalGet(o: Abs, key: string): Abs;
893
1040
  declare function $optionalInvoke(thisVal: Abs, method: string, args: Abs[]): Abs;
894
1041
  /** 静态方法:cls.staticMethod(args) */
895
1042
  declare function $staticInvoke(cls: Abs, method: string, args: Abs[]): Abs;
896
- /** 静态方法体内 super.m(args) / super[k](args)(R5):沿父类**静态**链查找
897
- * (home = 类值,[[Prototype]] = 父构造器——Bug 18 链),以接收者类值
898
- * 为 this 调用(原生 super.m() 的 this 是外围 this = 调用类,非父类)。 */
899
- declare function $staticSuperInvoke(thisVal: Abs, childName: string, key: Abs, args: Abs[]): Abs;
900
- /** 静态方法体内 super.k = v(R5 / SetSuper 静态面):沿父类静态链找 setter
901
- * (以接收者类值调用);getter-only 挡链 → strict TypeError;数据字段/
902
- * 缺槽 → 原生折接收者自有数据属性(OrdinarySetWithOwnDescriptor:
903
- * CreateDataProperty on this = 调用类值,父类槽不动)。 */
904
- declare function $setSuperStatic(thisVal: Abs, childName: string, key: Abs, value: Abs): Abs;
905
1043
  /** 计算属性写:o[kAbs] = v。非字面量 key → open + index join(不得写成字面槽 "?") */
906
1044
  declare function $setKey(o: Abs, key: Abs, value: Abs): Abs;
907
1045
 
1046
+ /**
1047
+ * RegExp brand 执行面(leaf-ish):从 class.ts 拆出,避免巨型文件。
1048
+ */
1049
+
1050
+ /**
1051
+ * 语句级 RegExp 状态写回(test/exec):执行并把 lastIndex 更新后的 brand
1052
+ * 返回给 transpile 重绑($reStateCall 与 $arrMutContainer 同模式)。
1053
+ * 表达式位置不写回($invoke 只读执行,调用方按 JS 语义先取值)。
1054
+ */
1055
+ declare function $reStateCall(re: Abs, method: string, args: Abs[]): Abs;
1056
+
908
1057
  /**
909
1058
  * 转译器无法正确 lowering 的构造:抛此错误(替代静默降级注释)。
910
1059
  * 消费方(tryRunTranspiled / body-fn)捕获后记录并 fail-closed
package/dist/exec.js CHANGED
@@ -206,7 +206,7 @@ import {
206
206
  withAssumePremises,
207
207
  withEvalBudgetOverride,
208
208
  withExecPhi
209
- } from "./chunk-W3Z77Y2I.js";
209
+ } from "./chunk-NUTYUT3I.js";
210
210
  export {
211
211
  $absVal,
212
212
  $add,
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
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-DhSqP3in.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 EvalPosRecord, a9 as ImplicationOracle, aa as LitValueResult, L as LiteralValue, ab as MAX_EVAL_CALL_DEPTH, ac as MAX_EVAL_TOTAL_CALLS, P as PrimName, ad as RUNTIME_IMPORT_RE, ae as TYPEOF_NAMES, af as TranspiledCallResult, ag as TypeofName, ah as abs, ai as absFunction, aj as absOnly, ak as absToString, al as and, am as anyAbs, an as anyVar, ao as app, ap as assumeFinite, aq as attachFnImpl, ar as bigintLit, as as bindImports, at as bindingsOf, au as bool, av as boolLit, aw as callTranspiledExport, ax as callTranspiledExportApply, ay as callTranspiledExportFull, az as collectAbsExports, aA as confJoin, aB as emptyPhi, aC as eq, aD as evalExprAbs, aE as ge, aF as geNum, aG as getEvalCallCollector, aH as getFnImpl, aI as getImplicationOracle, aJ as gt, aK as gtNum, aL as hostFnCtorFacet, aM as implies, aN as isAbsApplyResult, aO as isAbsVal, aP as isBigPrim, aQ as isCjsMainRun, aR as isExactLit, aS as isNumPrim, aT as isStrPrim, aU as le, aV as leNum, aW as lit, aX as litValue, aY as lt, aZ as ltNum, a_ as makeAbsApplyResult, a$ as markPureFn, b0 as namespaceAbsOf, b1 as ne, b2 as negatePred, b3 as never, b4 as not, b5 as noteEvalCallRecord, b6 as noteEvalFallback, b7 as num, b8 as numLit, b9 as numVar, ba as obj, bb as or, bc as pFalse, bd as pTrue, be as phiAnd, bf as predEquals, bg as predToString, bh as predVars, bi as primToTypeof, bj as ptypeof, bk as pureFnNameOf, bl as relationFingerprint, bm as relationFn, bn as resetEvalCallBudget, bo as runTranspiled, bp as runTranspiledOptionsMemoKey, bq as setEvalAssignCollector, br as setEvalBindingSink, bs as setEvalCallCollector, bt as setEvalFallbackCollector, bu as setImplicationOracle, bv as setPosCollector, bw as shapeOfTerm, bx as shapeOnlyFn, by as shapeToString, bz as simplifyTerm, bA as str, bB as strLit, bC as substPred, bD as termEquals, bE as termToString, bF as tryRunTranspiled, bG as unknown, bH as v } from './run-DhSqP3in.js';
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-DfloWX6i.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 EvalPosRecord, a9 as ImplicationOracle, aa as LitValueResult, L as LiteralValue, ab as MAX_EVAL_CALL_DEPTH, ac as MAX_EVAL_TOTAL_CALLS, P as PrimName, ad as RUNTIME_IMPORT_RE, ae as TYPEOF_NAMES, af as TranspiledCallResult, ag as TypeofName, ah as abs, ai as absFunction, aj as absOnly, ak as absToString, al as and, am as anyAbs, an as anyVar, ao as app, ap as assumeFinite, aq as attachFnImpl, ar as bigintLit, as as bindImports, at as bindingsOf, au as bool, av as boolLit, aw as callTranspiledExport, ax as callTranspiledExportApply, ay as callTranspiledExportFull, az as collectAbsExports, aA as confJoin, aB as emptyPhi, aC as eq, aD as evalExprAbs, aE as ge, aF as geNum, aG as getEvalCallCollector, aH as getFnImpl, aI as getImplicationOracle, aJ as gt, aK as gtNum, aL as hostFnCtorFacet, aM as implies, aN as isAbsApplyResult, aO as isAbsVal, aP as isBigPrim, aQ as isCjsMainRun, aR as isExactLit, aS as isNumPrim, aT as isStrPrim, aU as le, aV as leNum, aW as lit, aX as litValue, aY as lt, aZ as ltNum, a_ as makeAbsApplyResult, a$ as markPureFn, b0 as namespaceAbsOf, b1 as ne, b2 as negatePred, b3 as never, b4 as not, b5 as noteEvalCallRecord, b6 as noteEvalFallback, b7 as num, b8 as numLit, b9 as numVar, ba as obj, bb as or, bc as pFalse, bd as pTrue, be as phiAnd, bf as predEquals, bg as predToString, bh as predVars, bi as primToTypeof, bj as ptypeof, bk as pureFnNameOf, bl as relationFingerprint, bm as relationFn, bn as resetEvalCallBudget, bo as runTranspiled, bp as runTranspiledOptionsMemoKey, bq as setEvalAssignCollector, br as setEvalBindingSink, bs as setEvalCallCollector, bt as setEvalFallbackCollector, bu as setImplicationOracle, bv as setPosCollector, bw as shapeOfTerm, bx as shapeOnlyFn, by as shapeToString, bz as simplifyTerm, bA as str, bB as strLit, bC as substPred, bD as termEquals, bE as termToString, bF as tryRunTranspiled, bG as unknown, bH as v } from './run-DfloWX6i.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-DPPRBOLp.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-DPPRBOLp.js';
4
+ import { p as parseSource, L as LeakBudget, E as EffectiveInterfaceOpts, b as LoadDepsFingerprint, w as CheckReport, N as NudoConstraint, c as ProjectionBudget } from './projection-budget-07VnMktV.js';
5
+ export { x as CONSTRAINT_BUILDERS, y as CONSTRAINT_BUILDER_NAMES, z as CONSTRAINT_EXPR_RE, A as CheckAction, C as CheckIssue, B as CheckJson, D as CheckJsonMulti, F as ConstraintBuilder, G as Diagnostic, H as EffectiveInterface, J as GitlabCodeQualityIssue, K as INTERFACE_SOURCE_ABBR, O as InterfaceDiag, I as InterfaceSource, Q as InterfaceTierInfo, a as InterfaceTierOpts, R as NamedImport, S as NudoField, T as NudoFnConstraint, U as NudoSidecarError, V as NudoSig, W as RefineDiag, X as RefineEntry, Y as RefineResolveOpts, Z as SELF, _ as actionsForIssue, $ as andC, a0 as any, a1 as array, a2 as boolean, a3 as checkArg, a4 as checkCall, a5 as constraintAdmitsNullish, a6 as constraintToEntryAbs, a7 as derefConstraint, a8 as drainPromiseMicros, a9 as effectiveInterface, aa as enterPromiseExecutorScope, ab as evalPromiseCtor, ac as evalPromiseMethod, ad as evalPromiseStatic, ae as execNudoModule, af as extractDeclaredThrows, ag as extractFnBudget, ah as extractNudoImports, ai as extractRefineReturnFromSource, aj as extractRefinesFromSource, ak as fn, al as fnConstraintToEntryReqs, am as formatCheckReport, an as formatConstraint, ao as formatDiagnostics, ap as formatEffectiveInterfaceDisplay, aq as formatGithubAnnotations, ar as formatGitlabCodeQuality, as as formatInterfaceTierLine, at as generatedExportNames, au as getParseSourceCacheSize, av as getTerm, aw as instantiateConstraint, ax as interfaceDiagCount, ay as interfaceSourceOf, az as interfaceTierOf, aA as isIntFlag, aB as isNodeModulesPath, aC as isNudoConstraint, aD as lazy, aE as leavePromiseExecutorScope, aF as lenTerm, aG as litC, aH as localNamedExports, aI as notePromiseExecutorFork, aJ as nullable, aK as number, aL as omit, aM as partial, aN as pick, aO as queuePromiseMicro, aP as refineDiagCount, aQ as refineToIndexedFull, aR as resetNudoModuleExecCache, aS as resetParseSourceCache, aT as resetSidecarLoadFailureCache, aU as serializeCheckJson, aV as serializeCheckJsonMulti, aW as setInterfaceDiagCollector, aX as setRefineDiagCollector, aY as shape, aZ as sidecarClosureFingerprint, a_ as sidecarPathOf, a$ as string, b0 as takeInterfaceDiags, b1 as takeInterfaceDiagsSince, b2 as takeRefineDiags, b3 as takeRefineDiagsSince, b4 as throwConstraintToKinds, b5 as union } from './projection-budget-07VnMktV.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
  /**
@@ -249,13 +249,26 @@ declare function projectFlatMapResult(arrConf: Confidence, mapped: Abs[]): Abs;
249
249
  declare function asAbs(v: unknown): Abs | undefined;
250
250
 
251
251
  /**
252
- * 算术核:单调性 + 常量折叠 + 约束传播。
253
- * 这是「类型即计算」的主武器——x>0 时 x+1 必须得到 >1。
252
+ * 加减域:add(拼接/数值单调性/any 并集/sum 分发)与 sub(#175 自反
253
+ * 折叠 x−x→0 + subAssumeBounds 同名相关性引理)。
254
+ *
255
+ * 依赖方向不变量:只 import 叶子(shared/coerce/bounds)与 algebra 其它
256
+ * 既有模块;不得 import 兄弟域(muldiv/cmp)或 facade——运算族之间
257
+ * 零互调(sum 分发经 shared 的 eval2 回调自递归,不跨域)。
254
258
  */
255
259
 
256
260
  declare function add(a: Abs, b: Abs, phi?: Phi): Abs;
257
261
  /** 减法:a - b = a + (-b),数值上做单调性 */
258
262
  declare function sub(a: Abs, b: Abs, phi?: Phi, assume?: Phi): Abs;
263
+
264
+ /**
265
+ * 乘除模域:mul/div/mod 的区间单调性折叠;divAssumeBounds(issue #152
266
+ * 同名相关性除法界)与 div 的 0/x 字面量折叠(#170)在此消费。
267
+ *
268
+ * 依赖方向不变量:只 import 叶子(shared/coerce/bounds);不得 import
269
+ * 兄弟域(addsub/cmp)或 facade。
270
+ */
271
+
259
272
  /** 乘法:字面量直接求值;×正数同向缩放;×负数翻转不等式;×0 归零 */
260
273
  declare function mul(a: Abs, b: Abs, phi?: Phi): Abs;
261
274
  /**
@@ -269,6 +282,16 @@ declare function div(a: Abs, b: Abs, phi?: Phi, assume?: Phi): Abs;
269
282
  * `n % 0` / `x % 0` / `x % NaN` 恒为 NaN(JS)。
270
283
  */
271
284
  declare function mod(a: Abs, b: Abs, phi?: Phi): Abs;
285
+
286
+ /**
287
+ * 比较折叠域:cmp(双字面量/pred 蕴含/界判定 + eq/ne 符号面)、
288
+ * trueConstraint/falseConstraint(if 分支约束提取)、refineAbsForRelTrue、
289
+ * matchRelIdentLit。
290
+ *
291
+ * 依赖方向不变量:只 import 叶子(coerce/bounds);不得 import 兄弟域
292
+ * (addsub/muldiv)或 facade。
293
+ */
294
+
272
295
  /** 比较:返回 boolean Abs;若双字面量则 exact */
273
296
  declare function cmp(op: "lt" | "le" | "gt" | "ge" | "eq" | "ne", a: Abs, b: Abs, phi?: Phi): Abs;
274
297
  /** 从比较结果 Abs 提取「若为真」的额外约束(供 if 使用) */
@@ -366,12 +389,55 @@ declare function migrateInvariants(from: Abs, to: Abs): void;
366
389
  declare function evalMathMethod(name: string, args: Abs[]): Abs | undefined;
367
390
 
368
391
  /**
369
- * Object.assign 非 obj 源键投影 + Object.* 静态方法
392
+ * Object 静态面的 assign/描述符机器:assignSourceSlots(assign 源键投影)、
393
+ * primTargetAssignThrows(装箱 prim target 抛错域)、ToPropertyDescriptor
394
+ * 与安装(validateDefineTarget/validateDescriptorObject/
395
+ * applyPropertyDescriptor)、描述符形态(mkPropDescAbs/maybePropDescAbs)
396
+ * 与 [[Get]] 收口(readProperty)。
397
+ *
398
+ * Invariants:
399
+ * - 键投影只取自有可枚举字符串键(enumerable:false / Slot.internal 槽剔除;
400
+ * boxed String 的 length 不复制、[[PrimitiveValue]] 内部槽已标不可枚举);
401
+ * 键集未知(open 空箱/arr/brand/sum/fn)→ undefined 保守降级。
402
+ * - prim target 抛错域三档(M5 node 实测):bigint 恒定抛;string 字面量
403
+ * (长 L)遇 canonical 下标 < L 的源键定抛、下标 ≥ L/非下标键安全、键集
404
+ * 未知 → may;number/boolean wrapper expando 合法恒安全。
405
+ * - applyPropertyDescriptor 是 DefineOwnProperty 单一实现(create/
406
+ * defineProperty/defineProperties 共用,不复制):get/set 非函数且非
407
+ * undefined → 定抛;value × 访问器共存 → 定抛;访问器经 accessorTable
408
+ * 侧表派发(getter 读折返回体、setter 写走侧表不误抛 writable:false);
409
+ * 描述符字段语义 = 新建属性缺省 false、已有属性仅显式 false 收紧;
410
+ * open/index 标记与 invariants/accessor 侧表随不可变更新迁移。
411
+ * - readProperty 是反射/枚举内建 [[Get]] 统一入口:accessorTable thunk
412
+ * 优先(getter 求值)、数据槽兜底、setter-only 读 undefined。
413
+ *
414
+ * 兄弟模块边界:methods.ts(evalObjectMethod)经导出复用安装机器;
415
+ * readProperty 供 json.ts(stringify 读值)。
370
416
  */
371
417
 
372
418
  declare function assignSourceSlots(src: Abs): Record<string, {
373
419
  value: Abs;
374
420
  }> | undefined;
421
+
422
+ /**
423
+ * evalObjectMethod:Object.* 静态面大分派(create/keys/values/entries/
424
+ * hasOwn/getPrototypeOf/setPrototypeOf/assign/is/freeze 族/defineProperty
425
+ * 族/getOwnPropertyDescriptor(s)/getOwnPropertyNames/getOwnPropertySymbols/
426
+ * fromEntries/groupBy)。
427
+ *
428
+ * Invariants:
429
+ * - 枚举/读值/描述符机器复用 descriptor.ts 与 enum-entries.ts(单一实现不
430
+ * 复制);Error 家族判定经 error.ts facade(isErrorCtorName)。
431
+ * - 抽象接收者 may-nullish 只记 throws 效果、值域不变(Bug 27/35/61:仅
432
+ * any/unknown/含 nullish 臂 union 才记;prim/obj/tuple/fn/brand 形态
433
+ * 原生全定不假 may)。
434
+ * - create:null 原型走 nullProto 标记(in 不回退 Object.prototype);
435
+ * Abs 对象原型进 protoTable([[Prototype]] 事实,Bug 67——instanceof 链
436
+ * 终止判定不得把 null 终止链折 true);第二实参 propertiesObject 逐可
437
+ * 枚举键过 ToPropertyDescriptor 安装自有属性(Bug 32/23)。
438
+ * - 未建模方法 → undefined 走通用回退。
439
+ */
440
+
375
441
  /** Object.keys/values/entries/assign + 不变性方法 */
376
442
  declare function evalObjectMethod(name: string, args: Abs[]): Abs | undefined;
377
443
 
@@ -470,10 +536,51 @@ declare function objectProtoBrand(): Abs;
470
536
  declare function isObjectProtoBrand(a: Abs | undefined): boolean;
471
537
 
472
538
  /**
473
- * Error 家族 + evalBuiltinNew / evalBuiltinInstanceMethod + namespace 分派
539
+ * 命名空间静态分派:evalNamespaceCall 总入口 + 本地静态面(Map.groupBy /
540
+ * URL.canParse / ArrayBuffer.isView / BigInt.asIntN·asUintN)。
541
+ *
542
+ * Invariants:
543
+ * - 静态面只走「纯静态」(无接收者)调用;未建模方法返回 undefined 交通用
544
+ * 回退,不得折精确值。
545
+ * - Map.groupBy 与 Object.groupBy 共用 foldGroupBy(object 域单一折叠口径,
546
+ * 键模式 "map" 原始键 SameValueZero 字面量合并,不 ToPropertyKey);键
547
+ * 不可判组并入 shadow(get 未知键 → 元素域数组 join undefined)。
548
+ * - ArrayBuffer.isView 是纯谓词恒不抛(Invalid → false 非抛的口径只属于
549
+ * canParse):DV/TA brand → true、确定非视图闭形态 → false、不可判
550
+ * (any/unknown/未知 brand/mock 面)→ boolean 域不折字面量。
551
+ * - BigInt.asIntN/asUintN:bits 过 ToIndex(负数 → RangeError、bigint/
552
+ * symbol → TypeError)、value 过 ToBigInt(number/nullish → TypeError、
553
+ * 非法 string → SyntaxError),字面量可折时宿主真调用兜底。
554
+ *
555
+ * 兄弟模块边界:Intl/TypedArray 尾分派落在 intl.ts / binary.ts;实例方法
556
+ * 与 new 分派在 dispatch.ts。
474
557
  */
475
558
 
476
559
  declare function evalNamespaceCall(ns: string, method: string, args: Abs[]): Abs | undefined;
560
+
561
+ /**
562
+ * Error 家族(ERROR_CTOR_NAMES/isErrorCtorName/errorBrandAbs)+ 宿主构造器
563
+ * 实参校验谓词(sumHasPrimMember/isNullishLit/enforceCanBeHeldWeakly/
564
+ * isDefinitelyUndefinedArg)+ Proxy 构造(makeProxyAbs)。
565
+ *
566
+ * Invariants:
567
+ * - errorBrandAbs 槽插入序 = 原生 gOPN 观察序(stack→message→cause→
568
+ * errors);name 槽打 Slot.inherited(原型链槽:hasOwnProperty/gOPN 自有
569
+ * 面折 false,$set 覆写落地转自有);家族自有槽全 enumerable:false
570
+ * (Bug 84 枚举视图剔除,extends Error 内层公有槽展开同口径)。
571
+ * - message 过 ToString:symbol prim 定抛 TypeError、any/含 symbol 臂
572
+ * union → may(Bug 54);stack 恒 string 域不可精确折叠(Bug 59)。
573
+ * - 实参校验三档口径(Bug 37/41/53/63/85,两个派发点共用:exec/class $new
574
+ * 宿主分支与 dispatch.ts evalBuiltinNew):definite 原生 throw(prim 字面
575
+ * 量/缺省)→ NudoThrow;any/unknown/含坏成员 union → recordMayThrow(值
576
+ * 域不变);obj/fn/brand/tuple/arr 对象形态 → 原生全定。
577
+ * - isNullishLit 与 surface.isNullishLitAbs 同判定但**不引 surface**(避免
578
+ * builtins↔surface 新环);弱键分类本体在 collections.ts
579
+ * (classifyCanBeHeldWeakly,Bug 8 集合条目键单一口径),此处只落校验。
580
+ * - Proxy brand inner = target Abs(无陷阱读写走靶语义、isArray 剥 brand 看
581
+ * 靶形态);target/handler 引用挂 match-iter 侧表(Bug 57/71 陷阱派发)。
582
+ */
583
+
477
584
  declare function isErrorCtorName(name: string | undefined): boolean;
478
585
  /**
479
586
  * Error brand:shape 带 name/message(字面量 message 保精确)。
@@ -483,6 +590,32 @@ declare function isErrorCtorName(name: string | undefined): boolean;
483
590
  * $new 的 new Error 路径共用——catch 形参成员访问可解。
484
591
  */
485
592
  declare function errorBrandAbs(name: string, args: Abs[]): Abs;
593
+
594
+ /**
595
+ * 品牌总分派:evalBuiltinNew(new X(...))与 evalBuiltinInstanceMethod
596
+ * (brand 实例方法)+ DataView/TypedArray 实例方法族(evalDataViewMethod /
597
+ * taLengthSlotLit / taSetSourceLength / brandObjSlots)。
598
+ *
599
+ * Invariants:
600
+ * - 两入口是内建构造/实例方法的总分派(exec $new 宿主分支与 Abs 面
601
+ * evalBuiltinNew 共用各域 builder;未建模名/方法 → undefined 走通用
602
+ * 回退,不得折精确值)。
603
+ * - TA set 三段校验(Bug 38):ToIndex(offset) + ToObject(source) +
604
+ * off+srcLen > tgtLen 越界——长度读 binary 域构造入槽的 length 槽
605
+ * (makeTypedArrayAbs 数字形态)/ taSetSourceLength(tuple 元数/字符串
606
+ * 长度/TA 源槽/装箱折 0);成功恒返 undefined,元素拷贝值域不建模。
607
+ * - ArrayBuffer.resize(Bug 39):resizable 槽 false 字面量定抛
608
+ * TypeError;成功臂 byteLength 槽**原地更新**($set 引用语义惯例——
609
+ * 别名同步);transfer/grow/slice 不在此扩 scope。
610
+ * - DataView get/set 族(Bug 35):byteOffset 过 ToIndex + off+bits/8 >
611
+ * viewLen 定抛 RangeError;读返回域按元素类型(bigint 家族 → bigint)。
612
+ * - Error 家族 toString/toLocaleString = `${name}: ${message}`(槽已
613
+ * 建模,空 message 只返 name);Map/Set 方法族落 collections 条目机,
614
+ * 迭代三件套经 iterator.ts 协议对象(mapEntryKey/setEntryTuple 条目
615
+ * 投影),Set ES2025 方法族先过 binary 域 set-like 校验再 setMethodFold
616
+ * (不可折 → 集合运算诚实 unknown / is* 抽象 boolean)。
617
+ */
618
+
486
619
  /** new X(...) */
487
620
  declare function evalBuiltinNew(className: string, args: Abs[]): Abs | undefined;
488
621
  /** brand 实例方法(Date/RegExp/Map/Set/Error 家族/装箱拆箱后的 prim 面在外层) */