@nudojs/core 1.11.3 → 1.13.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.
@@ -47,7 +47,7 @@ import {
47
47
  withEvalBudgetOverride,
48
48
  withExecPhi,
49
49
  withFnBudgetOverride
50
- } from "./chunk-GL6VOF75.js";
50
+ } from "./chunk-A2PLG2QV.js";
51
51
 
52
52
  // src/algebra/directive-scan.ts
53
53
  function cleanDirectiveLine(raw, kind) {
@@ -1516,6 +1516,22 @@ function extractAssumeSegs(source, fnName) {
1516
1516
  }
1517
1517
  return out;
1518
1518
  }
1519
+ function fnTopLevelLocalNames(body) {
1520
+ const block = body;
1521
+ if (!block || block.type !== "BlockStatement" || !Array.isArray(block.body)) return [];
1522
+ const names = [];
1523
+ for (const stmt of block.body) {
1524
+ const decl = stmt;
1525
+ if (!decl || decl.type !== "VariableDeclaration" || !Array.isArray(decl.declarations)) {
1526
+ continue;
1527
+ }
1528
+ for (const d of decl.declarations) {
1529
+ const id = d?.id;
1530
+ if (id?.type === "Identifier" && typeof id.name === "string") names.push(id.name);
1531
+ }
1532
+ }
1533
+ return names;
1534
+ }
1519
1535
  function extractRefinesFromSource(source, fnName, opts = {}) {
1520
1536
  if (!stripStringsKeepComments(source).includes("@nudo:contract")) return [];
1521
1537
  const constraints = collectConstraints(source, opts);
@@ -5552,6 +5568,7 @@ export {
5552
5568
  execNudoModule,
5553
5569
  resetNudoModuleExecCache,
5554
5570
  extractAssumeSegs,
5571
+ fnTopLevelLocalNames,
5555
5572
  extractRefinesFromSource,
5556
5573
  refineToIndexedFull,
5557
5574
  extractRefineReturnFromSource,
package/dist/exec.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as Abs, M as MayThrowEffect, b as Phi } from './run-DaqGgSre.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-DaqGgSre.js';
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';
3
3
  import { Node, Expression, File } from '@babel/types';
4
4
 
5
5
  /**
@@ -58,11 +58,17 @@ declare function callAtFunctionBoundary<T>(body: () => T): T;
58
58
  * opts.ctor:Bug 9 可构造性 facet(箭头/方法/async/generator → false;
59
59
  * 函数表达式/类表达式值 → true)。
60
60
  * opts.padArgs:默认 true(Bug 7 缺参归一);读宿主 arguments 的
61
- * function 包装传 false(arguments.length 不得被补齐膨胀)。 */
61
+ * function 包装传 false(arguments.length 不得被补齐膨胀)。
62
+ * opts.length:Bug 69 原生 fn.length(首个默认值/rest 形参前的形参数)——
63
+ * 宿主 impl 是解糖产物(默认参占位 `_p{i}` 全成真参),长度不可信;
64
+ * transpile 侧记录真值,$len 的 fn 分支折 exact。 */
62
65
  declare function $fnVal(params: string[], impl: (...args: Abs[]) => Abs, opts?: {
63
66
  bindThis?: boolean;
64
67
  ctor?: boolean;
65
68
  padArgs?: boolean;
69
+ length?: number;
70
+ effectFree?: boolean;
71
+ closed?: boolean;
66
72
  }): Abs;
67
73
  /**
68
74
  * 宿主 this → Abs:函数体 prologue 用它承接 call/apply/bind 传入的 thisArg。
@@ -308,7 +314,9 @@ declare function $catchVal(e: unknown): Abs;
308
314
  /** 数组字面量 → ≤cap tuple(逐元素精确)/ >cap arr;策略与 containers.ts 同源 */
309
315
  declare function $arr(items: Abs[]): Abs;
310
316
  /**
311
- * `arguments` 对象 → 类数组 tuple($len/$idx 投影 length/下标;typeof 为 "object")。
317
+ * `arguments` 对象 → 类数组 **brand "Arguments"** 包 tuple 内层(Bug 56:
318
+ * 不是数组 exotic——`Array.isArray(arguments)` 原生 false;$idx/$len/$in/
319
+ * spread/Array.from 经委托/剥层保持下标/长度/迭代精确)。
312
320
  * strict/ESM 与形参**独立映射**:写 `arguments[i]` 不改形参,写形参不改 `arguments`。
313
321
  * (sloppy 非严格是 mapped arguments object,二者互相写回——Nudo 分析按 ESM/strict。)
314
322
  * 与 rest 绑定解耦:rest 仍从真实 `arguments`/rest 形参收集,本对象只服务用户写的 `arguments`。
@@ -341,7 +349,8 @@ declare function fillTuple(shape: {
341
349
  declare function $copy(a: Abs): Abs;
342
350
  /** 数组/元组方法(push/pop/shift/unshift/splice/reverse/sort/copyWithin/fill)
343
351
  * 的就地 mutator:Abs 身份不变(JS 引用语义——`const b = a; b.push(4)` 对 a
344
- * 可见);transpile 重绑 `a = $arrMutContainer(a, …)` 仍写回同一对象。 */
352
+ * 可见)。$invoke 的 mutator 分支在**调用点**即刻执行本函数(表达式求值
353
+ * 顺序正确,Bug 49/51),别名 / 成员槽 / Map 条目经共享 Abs 同步可见。 */
345
354
  declare function $arrMutContainer(arr: Abs, method: string, args: Abs[]): Abs;
346
355
  /** 下标读 a[i];规范数组下标走精确投影,确定非下标键 → undefined,否则并所有元素;string[i] → 单字符 */
347
356
  declare function $idx(a: Abs, i: Abs, opts?: {
@@ -428,18 +437,19 @@ declare function $get(o: Abs, key: string, opts?: {
428
437
  declare function $collectionForEach(recv: Abs, cb: unknown): Abs | undefined;
429
438
  /** 成员写:返回新 obj/brand(不可变更新);frozen/sealed/只读目标按 sloppy 静默失败。
430
439
  * opts.internal(Bug 84):私有字段落地——槽打 Slot.internal 标记;后续覆写
431
- * 保留既有标记(this.#x = v 不丢失 internal)。 */
440
+ * 保留既有标记(this.#x = v 不丢失 internal)。
441
+ * opts.symbolKey(Bug 73):计算 symbol 键投影([Symbol.X] → "@@X")落地
442
+ * ——槽打 Slot.symbolKey 标记(JSON.stringify 等字符串键枚举面跳过);
443
+ * 覆写保留既有标记。 */
432
444
  declare function $set(o: Abs, key: string, value: Abs, opts?: {
433
445
  internal?: boolean;
446
+ symbolKey?: boolean;
434
447
  }): Abs;
435
448
 
436
449
  /**
437
450
  * async / await / generator / ??($nullishTest / $removeNullish)。
438
451
  */
439
452
 
440
- /**
441
- * async 函数体包进 thunk,返回值经 wrapPromise。
442
- */
443
453
  declare function $async(thunk: () => Abs): Abs;
444
454
  /** await → 解包 eff("promise") */
445
455
  declare function $await(v: Abs): Abs;
@@ -457,10 +467,17 @@ declare function $asyncReturn(v: Abs): Abs;
457
467
  * 首个 done:true 作为 value 交付(node 实测:此后 next 回 undefined)。
458
468
  * Bug 22:结果从 yield 元组数组改为生成器对象(next/return/throw 方法面 +
459
469
  * constructor 身份);元素域经侧表保留($arr 的 ≤cap tuple / >cap arr
460
- * widen 策略不变),迭代路径(for-of/spread/Array.from)继续工作。 */
470
+ * widen 策略不变),迭代路径(for-of/spread/Array.from)继续工作。
471
+ * Bug 53:侧表/next() 消费完整收集序列(ys.els)——$arr >cap widen 只影响
472
+ * 形状槽(类型面),不再把 >8 yield 截断成单元素流。
473
+ * Bug 52:yield 点 try 上下文(ys.ctxs,$yield 第二实参)随序列传递——
474
+ * .return()/.throw() 挂起点语义见 makeGenObject。 */
461
475
  declare function $gen(body: () => Abs): Abs;
462
- /** yield v:压入当前生成器收集器;表达式值用 unknown */
463
- declare function $yield(v: Abs): Abs;
476
+ /** yield v:压入当前生成器收集器;表达式值用 unknown。
477
+ * tryCtx(Bug 52)= transpile 静态标注的 yield 点 try 上下文位
478
+ * (YIELD_TRY_FINALLY / YIELD_TRY_CATCH),.return()/.throw() 挂起点
479
+ * 语义用(见 makeGenObject)。 */
480
+ declare function $yield(v: Abs, tryCtx?: number): Abs;
464
481
  /** yield* v(Bug 82):委托迭代 ≠ yield v——GetIterator 校验先行($elems
465
482
  * 同分类器:非可迭代接收者 definite/may TypeError,生成器体内按 $gen
466
483
  * 迭代期语义由外层帧吸收),**元素**逐个压入收集器(此前把整个可迭代值
@@ -468,7 +485,7 @@ declare function $yield(v: Abs): Abs;
468
485
  * iterator 的 done 值,不可判)→ 保守 unknown。长度不可判的接收者
469
486
  * (arr/any/…)单代表元素过近似并入 + bumpGenPathSensitive 压 conf
470
487
  * (mergeArmYields 同口径,禁 exact 元组出货)。 */
471
- declare function $yieldStar(v: unknown): Abs;
488
+ declare function $yieldStar(v: unknown, tryCtx?: number): Abs;
472
489
  /**
473
490
  * `??` 非 nullish 臂:从左值 Abs 剥离 nullish 部分($nullishTest 判 true
474
491
  * 的成员)。索引访问 `M[k]` 对抽象键产出 joinAbs(element, undef()),
@@ -590,6 +607,13 @@ type TranspileOptions = {
590
607
  hasTryHandler?: boolean;
591
608
  /** 当前 try 的 catch 体是否可能 rethrow(正常路径 soft 效果 release 而非 digest) */
592
609
  tryRethrowCatch?: boolean;
610
+ /** yield 点 try 上下文位(Bug 52):进入 try 块/catch 体时按位 OR——
611
+ * 1 = 外层任一 try 带 finally,2 = 外层任一 try 带 catch(数值与
612
+ * runtime/control.ts 的 YIELD_TRY_FINALLY / YIELD_TRY_CATCH 同步);
613
+ * R1a catch 事实位(16/32/64)描述**最近** enclosing catch:16 = 含
614
+ * return,32 = 含 yield,64 = 可能 rethrow 进外层 catch(结局不可分类)。
615
+ * 发射为 $yield/$yieldStar 第二实参;函数/方法体边界重置为 0。 */
616
+ yieldTryCtx?: number;
593
617
  /** 分支/循环体内深度(赋值记录 conditional 标记;inLoop 也计入) */
594
618
  conditionalFlow?: number;
595
619
  /** 函数/箭头体内(顶层绑定表只收顶层作用域) */
@@ -635,6 +659,22 @@ type TranspileOptions = {
635
659
  * 声明语句),此类名字从提升集扣除、不发改赋值。
636
660
  */
637
661
  keepVarDecl?: boolean;
662
+ /**
663
+ * issue #165:文件含 `@nudo:assume` 引理——transpileFile 顶层对源文本
664
+ * 做一次 includes 判定后置位。文件级快速门:无引理的文件不进锚定收集,
665
+ * 发射产物逐字节不变(零插桩开销)。
666
+ */
667
+ assumeDirectiveFile?: boolean;
668
+ /**
669
+ * issue #165:待锚定的 declarator AST 节点集合(按对象身份匹配)——
670
+ * 函数体**直接子语句** VariableDeclaration 中带 init 的 Identifier
671
+ * declarator。发射位对命中者把 init 包 `$assumeAnchor(init, name)`
672
+ *(SSA:@nudo:assume 引理作用于绑定值,从定义点到作用域尾)。嵌套块 /
673
+ * for-init / 解构不收;嵌套函数体在自身边界重算(并集外层集合)。
674
+ * 运行时护栏(premise 不含该名的 le 原子则直通原值)见
675
+ * exec/runtime/ops.ts。
676
+ */
677
+ anchorDeclNodes?: ReadonlySet<object>;
638
678
  /**
639
679
  * 节点级 Abs 记录插桩(hover 重放用):Identifier 值读与
640
680
  * 静态成员读的转译输出包 `$nodoPos(<src>, line, column)`,
@@ -713,14 +753,34 @@ type EvalClassSpec = {
713
753
  * (Super constructor null … is not a constructor);显式 super() 同抛($super)。
714
754
  */
715
755
  superNull?: boolean;
756
+ /**
757
+ * N2:extends 目标是**宿主**内建构造器(host fn 或 builtinCtorAbs brand
758
+ * 身份)——类值静态读/调用(B.keys / E.captureStackTrace)沿链到未注册
759
+ * 父名时凭此标记走宿主静态通道。mock/桥接父类(fn Abs 同名)不带标记
760
+ * → 无通道 → sound unknown(不折 undefined / 不误派发宿主真值)。
761
+ */
762
+ superBuiltinHost?: boolean;
716
763
  ctor?: (thisVal: Abs, ...args: Abs[]) => Abs;
717
764
  methods?: Record<string, (thisVal: Abs, ...args: Abs[]) => Abs>;
718
765
  /** 实例方法形参展示名(AST 形参名;未调用方法槽 `shape.params` 用) */
719
766
  methodParams?: Record<string, string[]>;
720
- staticMethods?: Record<string, (...args: Abs[]) => Abs>;
767
+ /** R5:静态方法 impl 首参 __this = 类值(接收者——沿链调用时是调用类) */
768
+ staticMethods?: Record<string, (thisVal: Abs, ...args: Abs[]) => Abs>;
721
769
  /** 静态方法形参展示名 */
722
770
  staticMethodParams?: Record<string, string[]>;
723
- statics?: Record<string, Abs>;
771
+ /**
772
+ * P2b:构造器元数(首个默认值/rest 形参前的形参数,nativeParamArity
773
+ * 口径)——类值 .length 自有属性。隐式构造器(基类零参 / 派生
774
+ * `(...args){super(...args)}`)恒 0。transpile 期记录;未记录的手写
775
+ * spec(mock 等)undefined → $get 折诚实 unknown(不假 0)。
776
+ */
777
+ ctorLength?: number;
778
+ /**
779
+ * 静态字段:R5 起值可为 thunk(以类值为 this 求值——原生
780
+ * ClassFieldDefinitionEvaluation 的 receiver 是类值;箭头/`this.x`
781
+ * 读写随之恢复)。旧行(宿主 Abs)保持兼容。
782
+ */
783
+ statics?: Record<string, Abs | ((cls: Abs) => Abs)>;
724
784
  /**
725
785
  * Bug 59:实例字段——每次 $new 以新实例为 this 按源序求值(原生
726
786
  * InitializeInstanceElements)。name 为字面量键;key 为计算键的
@@ -795,14 +855,33 @@ declare function $invoke(thisVal: Abs, method: string, args: Abs[], loc?: [numbe
795
855
  declare function $invokeSuper(thisVal: Abs, childName: string, method: string, args: Abs[]): Abs;
796
856
  /** 类实例方法内 super.p / super[k] 属性读(Bug 14):父类原型链上的
797
857
  * 访问器以 this 调用;实例字段/自有槽不在查找面(super 读的是原型)。
798
- * 方法作为值(super.m 未调用)不做 fn Abs 投影——诚实 unknown。 */
858
+ * 方法作为值(super.m 未调用)不做 fn Abs 投影——诚实 unknown。
859
+ * R2a:闭链缺槽折 undefined——父链全为已注册求值类且终止于「无
860
+ * extends」(尾巴 Object.prototype)/「extends null」(无尾巴)时,
861
+ * 缺键原生读 undefined(`super.x += 5` 折 NaN);setter-only 访问器
862
+ * 挡链读同样 undefined。宿主基类(extends Array/Error 等未注册名)/
863
+ * 抽象键 → 链开 → 诚实 unknown。Object.prototype 尾巴与 $get 闭 obj
864
+ * 缺槽同口径(方法名/constructor/__proto__ 不折 undefined)。 */
799
865
  declare function $getSuper(thisVal: Abs, childName: string, key: Abs): Abs;
866
+ /** 类实例方法/构造器内 super.k = v(Bug 55):SetSuper——沿父类原型链找
867
+ * setter(以接收者 this 调用);getter-only 挡链 → strict TypeError;
868
+ * 无 setter → 原生折接收者自有数据属性(CreateDataProperty on this)。
869
+ * 子类自有同名访问器不拦截 super 写(查找从父类起)——绕过 $set 的
870
+ * 访问器派发直写接收者槽(brand 内层 in-place,引用语义)。 */
871
+ declare function $setSuper(thisVal: Abs, childName: string, key: Abs, value: Abs): Abs;
800
872
  /** 类实例方法内 super[k](args) 计算键调用(Bug 14):ToPropertyKey 后沿父类链派发 */
801
873
  declare function $invokeSuperKey(thisVal: Abs, childName: string, key: Abs, args: Abs[]): Abs;
802
874
  /** super.m() / super[k]():原型链方法查找 + receiver 注入调用 */
803
875
  declare function $invokeSuperObj(thisVal: Abs, key: Abs, args: Abs[]): Abs;
804
- /** super.v / super[k]:原型链属性读(访问器 getter 以 this 调用;数据槽直读) */
876
+ /** super.v / super[k]:原型链属性读(访问器 getter 以 this 调用;数据槽直读)。
877
+ * R2a:闭链缺槽折 undefined——home 原型链全为闭 obj 且终止(无记录
878
+ * 原型 → Object.prototype 尾巴 / 显式 null-proto)时缺键原生读
879
+ * undefined;开 obj / 品牌 / 超深链 → 链开 → 诚实 unknown。 */
805
880
  declare function $getSuperObj(thisVal: Abs, key: Abs): Abs;
881
+ /** 对象字面量方法内 super.k = v(Bug 55 home object 面):home 原型链
882
+ * (运行时侧表)上找访问器 setter(以接收者调用);getter-only →
883
+ * strict TypeError;数据槽/缺槽 → 原生折接收者自有写($set)。 */
884
+ declare function $setSuperObj(thisVal: Abs, key: Abs, value: Abs): Abs;
806
885
  declare function $thisGet(thisVal: Abs, key: string): Abs;
807
886
  declare function $thisSet(thisVal: Abs, key: string, value: Abs): Abs;
808
887
  /** 解构默认值:undefined(含 sum 成员 / 可能缺失)时用 default 并入非 undefined 部分 */
@@ -814,6 +893,15 @@ declare function $optionalGet(o: Abs, key: string): Abs;
814
893
  declare function $optionalInvoke(thisVal: Abs, method: string, args: Abs[]): Abs;
815
894
  /** 静态方法:cls.staticMethod(args) */
816
895
  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;
817
905
  /** 计算属性写:o[kAbs] = v。非字面量 key → open + index join(不得写成字面槽 "?") */
818
906
  declare function $setKey(o: Abs, key: Abs, value: Abs): Abs;
819
907
 
@@ -837,4 +925,4 @@ declare class NudoUnsupportedError extends Error {
837
925
  detail?: string);
838
926
  }
839
927
 
840
- export { $absVal, $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, $getSuper, $getSuperObj, $gt, $idx, $idxSet, $importMeta, $in, $instanceof, $instanceofNonIdent, $invoke, $invokeSuper, $invokeSuperKey, $invokeSuperObj, $isBreakTo, $isForkExit, $iterCheck, $join, $le, $len, $lit, $loopBreak, $loopContinue, $loopReturn, $lt, $mod, $mul, $narrowMemberEq, $narrowTypeOf, $ne, $neLoose, $neg, $new, $newTarget, $not, $nullishTest, $obj, $objAccessor, $objAccessorKey, $objRest, $optionalGet, $optionalInvoke, $orDefault, $pow, $pushLoopExit, $rawThis, $reStateCall, $refineRel, $regex, $removeMemberNullish, $removeNull, $removeNullish, $removeUndefined, $restBind, $rethrowIfNudoReturn, $set, $setKey, $setProto, $shl, $shr, $spread, $staticInit, $staticInvoke, $sub, $super, $switch, $thisGet, $thisSet, $throw, $toNumber, $toNumeric, $tpl, $tryCurrentMark, $tryDetachSoftCatch, $tryDigestSoftCatch, $tryDiscardSoft, $tryMark, $tryOrphanSoft, $tryPopMark, $tryReleaseSoftCatch, $tryReleaseSoftOut, $tryTakeSince, $typeof, $unknown, $updateAdd, $updateSub, $ushr, $while, $whileSeq, $yield, $yieldStar, DEFAULT_MAX_LOOP_ITERS, type EvalClassSpec, NudoLoopSignal, NudoReturn, NudoThrow, NudoUnsupportedError, type TranspileOptions, asAbsVal, callAtFunctionBoundary, clearBClasses, clearStaleTermPred, currentAssumePremises, 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, withAssumePremises, withExecPhi };
928
+ export { $absVal, $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, $getSuper, $getSuperObj, $gt, $idx, $idxSet, $importMeta, $in, $instanceof, $instanceofNonIdent, $invoke, $invokeSuper, $invokeSuperKey, $invokeSuperObj, $isBreakTo, $isForkExit, $iterCheck, $join, $le, $len, $lit, $loopBreak, $loopContinue, $loopReturn, $lt, $mod, $mul, $narrowMemberEq, $narrowTypeOf, $ne, $neLoose, $neg, $new, $newTarget, $not, $nullishTest, $obj, $objAccessor, $objAccessorKey, $objRest, $optionalGet, $optionalInvoke, $orDefault, $pow, $pushLoopExit, $rawThis, $reStateCall, $refineRel, $regex, $removeMemberNullish, $removeNull, $removeNullish, $removeUndefined, $restBind, $rethrowIfNudoReturn, $set, $setKey, $setProto, $setSuper, $setSuperObj, $setSuperStatic, $shl, $shr, $spread, $staticInit, $staticInvoke, $staticSuperInvoke, $sub, $super, $switch, $thisGet, $thisSet, $throw, $toNumber, $toNumeric, $tpl, $tryCurrentMark, $tryDetachSoftCatch, $tryDigestSoftCatch, $tryDiscardSoft, $tryMark, $tryOrphanSoft, $tryPopMark, $tryReleaseSoftCatch, $tryReleaseSoftOut, $tryTakeSince, $typeof, $unknown, $updateAdd, $updateSub, $ushr, $while, $whileSeq, $yield, $yieldStar, DEFAULT_MAX_LOOP_ITERS, type EvalClassSpec, NudoLoopSignal, NudoReturn, NudoThrow, NudoUnsupportedError, type TranspileOptions, asAbsVal, callAtFunctionBoundary, clearBClasses, clearStaleTermPred, currentAssumePremises, 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, withAssumePremises, withExecPhi };
package/dist/exec.js CHANGED
@@ -98,11 +98,15 @@ import {
98
98
  $set,
99
99
  $setKey,
100
100
  $setProto,
101
+ $setSuper,
102
+ $setSuperObj,
103
+ $setSuperStatic,
101
104
  $shl,
102
105
  $shr,
103
106
  $spread,
104
107
  $staticInit,
105
108
  $staticInvoke,
109
+ $staticSuperInvoke,
106
110
  $sub,
107
111
  $super,
108
112
  $switch,
@@ -202,7 +206,7 @@ import {
202
206
  withAssumePremises,
203
207
  withEvalBudgetOverride,
204
208
  withExecPhi
205
- } from "./chunk-GL6VOF75.js";
209
+ } from "./chunk-A2PLG2QV.js";
206
210
  export {
207
211
  $absVal,
208
212
  $add,
@@ -302,11 +306,15 @@ export {
302
306
  $set,
303
307
  $setKey,
304
308
  $setProto,
309
+ $setSuper,
310
+ $setSuperObj,
311
+ $setSuperStatic,
305
312
  $shl,
306
313
  $shr,
307
314
  $spread,
308
315
  $staticInit,
309
316
  $staticInvoke,
317
+ $staticSuperInvoke,
310
318
  $sub,
311
319
  $super,
312
320
  $switch,
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-DaqGgSre.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-DaqGgSre.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-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';
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-CeoxA06q.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-CeoxA06q.js';
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';
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
  /**
@@ -457,7 +457,6 @@ declare function hostBuiltinCtorName(v: unknown): string | undefined;
457
457
  * null-proto 无 Object.prototype.constructor → undefined(读侧走 undef)。
458
458
  */
459
459
  declare function ctorNameOfRecv(recv: Abs): string | undefined;
460
- /** `X.prototype` 形态(getPrototypeOf 结果;带 constructor 槽) */
461
460
  declare function protoBrandAbs(ctorName: string): Abs;
462
461
  /**
463
462
  * Object.getPrototypeOf 的具体原型投影(constructor 链可解)。
@@ -579,6 +578,17 @@ type Slot = {
579
578
  optional?: boolean;
580
579
  readonly?: boolean;
581
580
  internal?: boolean;
581
+ /** Bug 66:原型链解析槽(errorBrandAbs 的 name——原生经 X.prototype.name
582
+ * 可见,非实例自有)。$get 直读 / $in 存在性照常;自有面 introspection
583
+ * (hasOwnProperty / propertyIsEnumerable / Object.hasOwn / gOPN)折
584
+ * false;$set 公有覆写落地转自有(e.name = "X" 原生建自有可枚举属性)。 */
585
+ inherited?: boolean;
586
+ /** Bug 73:计算 symbol 键投影槽([Symbol.X] → "@@X",transpile 期
587
+ * $set opts.symbolKey 打标)。原生 symbol 键对 JSON.stringify 等
588
+ * 字符串键枚举面不可见;字面量字符串键 {"@@lit":1} 无标记、照常
589
+ * 序列化——不得用 "@@" 前缀语法过滤(会误滤)。$get/$set/$in 直连
590
+ * 键访问不受影响。 */
591
+ symbolKey?: boolean;
582
592
  };
583
593
  /** ES 规范数组下标(无前导零、< 2^32-1);非规范键返回 undefined */
584
594
  declare function canonicalArrayIndex(v: unknown): number | undefined;
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ import {
21
21
  extractRefinesFromSource,
22
22
  findFnDirectiveScope,
23
23
  fnDirectiveCommentLines,
24
+ fnTopLevelLocalNames,
24
25
  formatConstraint,
25
26
  formatEffectiveInterfaceDisplay,
26
27
  formatInterfaceTierLine,
@@ -65,7 +66,7 @@ import {
65
66
  takeInterfaceDiagsSince,
66
67
  takeRefineDiags,
67
68
  takeRefineDiagsSince
68
- } from "./chunk-2PFT7GU2.js";
69
+ } from "./chunk-V2XC3V72.js";
69
70
  import {
70
71
  $add,
71
72
  $arguments,
@@ -525,7 +526,7 @@ import {
525
526
  withAssumePremises,
526
527
  withExecPhi,
527
528
  withVar
528
- } from "./chunk-GL6VOF75.js";
529
+ } from "./chunk-A2PLG2QV.js";
529
530
 
530
531
  // src/environment.ts
531
532
  function createEnvironment(parent, bindings = /* @__PURE__ */ new Map()) {
@@ -2371,9 +2372,11 @@ function assumePremisesPhiOf(name, source, file, issues) {
2371
2372
  const segs = extractAssumeSegs(source, name);
2372
2373
  if (segs.length === 0) return void 0;
2373
2374
  const meta = extractFn(source, name, file);
2375
+ const locals = fnTopLevelLocalNames(meta?.body);
2374
2376
  const bindable = /* @__PURE__ */ new Set([
2375
2377
  ...contractParamNameSet(meta?.formals ?? []),
2376
- ...meta?.params ?? []
2378
+ ...meta?.params ?? [],
2379
+ ...locals
2377
2380
  ]);
2378
2381
  const surface = [...bindable].join(", ");
2379
2382
  const preds = [];
@@ -2396,10 +2399,10 @@ function assumePremisesPhiOf(name, source, file, issues) {
2396
2399
  issues.push({
2397
2400
  severity: "error",
2398
2401
  code: "nudo:assume-invalid",
2399
- message: `${name}: @nudo:assume parameter name(s) not in the formal parameter list (${bad.join(", ")})`,
2402
+ message: `${name}: @nudo:assume name(s) not bound as parameters or top-level locals (${bad.join(", ")})`,
2400
2403
  actual: bad.join(", "),
2401
- expected: surface || "(no params)",
2402
- suggestion: `reference one of: ${surface || "(function has no params)"}`,
2404
+ expected: surface || "(no params/locals)",
2405
+ suggestion: `reference one of: ${surface || "(no params or top-level locals)"}`,
2403
2406
  fn: name
2404
2407
  });
2405
2408
  continue;
@@ -1,7 +1,7 @@
1
- import { I as InterfaceSource, a as InterfaceTierOpts, p as parseSource, C as CheckIssue } from './projection-budget-CeoxA06q.js';
2
- export { L as LeakBudget, b as LoadDepsFingerprint, M as MAX_PROMISE_MICROS, P as PROJECTION_MAX_DEPTH, c as ProjectionBudget, d as ProjectionStopReason, e as defaultLeakBudget, f as exceedsBudget, g as exportedNameOfLocal, h as extractAllLoadSpecs, i as getPromiseMicrosLength, l as leakIfNeeded, j as loadModuleDepsFingerprint, m as maybeLeak, n as normPath, r as resetLeakCounter, k as resolveDepPath, s as sidecarSpecsOf, o as stablePathKey, q as stablePathKeyGraph, t as termDepth, u as termNodes } from './projection-budget-CeoxA06q.js';
3
- import { A as Abs, T as Term, c as AbsModuleExports, d as AstEnv } from './run-DaqGgSre.js';
4
- export { $ as $tryDigestSoft, e as $tryMarkSoft, f as $tryReleaseSoft, E as ERROR_FAMILY, g as EvalFallbackStats, M as MayThrowEffect, h as absLit, i as absNumLit, j as absStrLit, k as allAbsStr, l as clearPureCallMemo, m as clearPureMemo, n as enterEvalCallBudgetSession, o as errorTypeAbs, p as exitEvalCallBudgetSession, q as filterDeclaredThrows, r as filterGateThrows, s as filterIgnoredThrows, t as flushMayThrowEffects, u as formatThrowsAbs, v as getEvalCallBudgetState, w as getEvalFallbackStats, x as getMayThrowCollector, y as isThrowsIgnored, z as mayThrowEffectsToAbs, B as orphanMayThrowEffects, D as popMayThrowFrame, F as pushMayThrowFrame, G as recordMayThrow, H as resetEvalFallbackStats, I as runWithMayThrowSession, J as setMayThrowCollector, K as throwAbsToKinds, N as throwsKindCovered, O as withEvalBudgetOverride } from './run-DaqGgSre.js';
1
+ import { I as InterfaceSource, a as InterfaceTierOpts, p as parseSource, C as CheckIssue } from './projection-budget-DPPRBOLp.js';
2
+ export { L as LeakBudget, b as LoadDepsFingerprint, M as MAX_PROMISE_MICROS, P as PROJECTION_MAX_DEPTH, c as ProjectionBudget, d as ProjectionStopReason, e as defaultLeakBudget, f as exceedsBudget, g as exportedNameOfLocal, h as extractAllLoadSpecs, i as getPromiseMicrosLength, l as leakIfNeeded, j as loadModuleDepsFingerprint, m as maybeLeak, n as normPath, r as resetLeakCounter, k as resolveDepPath, s as sidecarSpecsOf, o as stablePathKey, q as stablePathKeyGraph, t as termDepth, u as termNodes } from './projection-budget-DPPRBOLp.js';
3
+ import { A as Abs, T as Term, c as AbsModuleExports, d as AstEnv } from './run-DhSqP3in.js';
4
+ export { $ as $tryDigestSoft, e as $tryMarkSoft, f as $tryReleaseSoft, E as ERROR_FAMILY, g as EvalFallbackStats, M as MayThrowEffect, h as absLit, i as absNumLit, j as absStrLit, k as allAbsStr, l as clearPureCallMemo, m as clearPureMemo, n as enterEvalCallBudgetSession, o as errorTypeAbs, p as exitEvalCallBudgetSession, q as filterDeclaredThrows, r as filterGateThrows, s as filterIgnoredThrows, t as flushMayThrowEffects, u as formatThrowsAbs, v as getEvalCallBudgetState, w as getEvalFallbackStats, x as getMayThrowCollector, y as isThrowsIgnored, z as mayThrowEffectsToAbs, B as orphanMayThrowEffects, D as popMayThrowFrame, F as pushMayThrowFrame, G as recordMayThrow, H as resetEvalFallbackStats, I as runWithMayThrowSession, J as setMayThrowCollector, K as throwAbsToKinds, N as throwsKindCovered, O as withEvalBudgetOverride } from './run-DhSqP3in.js';
5
5
  import { File, Node } from '@babel/types';
6
6
 
7
7
  /**
package/dist/internal.js CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  stableAnalyzeKeySource,
22
22
  stablePathKey,
23
23
  stablePathKeyGraph
24
- } from "./chunk-2PFT7GU2.js";
24
+ } from "./chunk-V2XC3V72.js";
25
25
  import {
26
26
  $tryDigestSoft,
27
27
  $tryMarkSoft,
@@ -169,7 +169,7 @@ import {
169
169
  withEvalBudgetOverride,
170
170
  withFnBudgetOverride,
171
171
  wrapPromise
172
- } from "./chunk-GL6VOF75.js";
172
+ } from "./chunk-A2PLG2QV.js";
173
173
 
174
174
  // src/algebra/inlay.ts
175
175
  function listFunctions(source) {
@@ -1,5 +1,5 @@
1
1
  import { File } from '@babel/types';
2
- import { A as Abs, T as Term, P as PrimName, a as Pred, L as LiteralValue, b as Phi, C as Confidence } from './run-DaqGgSre.js';
2
+ import { A as Abs, T as Term, P as PrimName, a as Pred, L as LiteralValue, b as Phi, C as Confidence } from './run-DhSqP3in.js';
3
3
 
4
4
  declare function resetParseSourceCache(): void;
5
5
  declare function getParseSourceCacheSize(): number;
@@ -13,7 +13,7 @@ declare function parseSource(source: string, opts?: {
13
13
  */
14
14
 
15
15
  declare function enterPromiseExecutorScope(): void;
16
- declare function leavePromiseExecutorScope(): number;
16
+ declare function leavePromiseExecutorScope(settledArms: number[]): boolean;
17
17
  /** $fork 在 executor 内发生时打点(多臂 resolve 需 join,不得 first-wins 假精确) */
18
18
  declare function notePromiseExecutorFork(): void;
19
19
  /** 队列硬上限:无界增长是 LSP 长会话泄漏点(只进不出的模块求值路径) */
@@ -155,12 +155,15 @@ type Shape = {
155
155
  type: PrimName;
156
156
  } | {
157
157
  k: "obj";
158
- /** 槽形与 objects.ts Slot 同构(含 Bug 84 internal 私有槽标记) */
158
+ /** 槽形与 objects.ts Slot 同构(含 Bug 84 internal 私有槽标记 /
159
+ * Bug 73 symbolKey 计算符号键标记 / Bug 66 inherited 原型链解析槽) */
159
160
  slots: Record<string, {
160
161
  value: Abs;
161
162
  optional?: boolean;
162
163
  readonly?: boolean;
163
164
  internal?: boolean;
165
+ symbolKey?: boolean;
166
+ inherited?: boolean;
164
167
  }>;
165
168
  index?: {
166
169
  key: Abs;
@@ -209,6 +212,7 @@ type Shape = {
209
212
  eff: "promise" | "generator";
210
213
  inner: Abs;
211
214
  rejected?: Abs;
215
+ unsettled?: boolean;
212
216
  } | {
213
217
  k: "sum";
214
218
  members: Abs[];
@@ -626,9 +630,11 @@ type AbsFnImpl = {
626
630
  */
627
631
  apply?: (args: Abs[], thisVal?: Abs) => AbsApplyReturn;
628
632
  /**
629
- * 对象方法(ObjectMethod / 方法型 FunctionExpression):$invoke 时把
630
- * receiver 作为 apply 的**首参**注入。shape.params 仍是用户可见形参
631
- * (不含 receiver),自由调用不注入 → this 为 unbound(JS 语义)。
633
+ * 对象方法(ObjectMethod / 方法型 FunctionExpression):$call 派发统一把
634
+ * receiver($call 第三参 thisVal;成员调用 = 接收者,直接调用 / call /
635
+ * apply / bind 缺省 = undefined)注入 apply 的**首参**。shape.params 仍是
636
+ * 用户可见形参(不含 receiver);自由调用注入 undefined → this 为
637
+ * unbound(JS 语义)。$new(可构造方法值)同样注入新实例。
632
638
  */
633
639
  bindThis?: boolean;
634
640
  /**
@@ -656,6 +662,21 @@ type AbsFnImpl = {
656
662
  };
657
663
  /** `@nudo:pure`:调用结果按实参记忆化(无副作用契约) */
658
664
  pureName?: string;
665
+ /**
666
+ * M4:transpile 静态判定的「无副作用面」facet(保守:任意赋值/自增/
667
+ * 调用/delete/标签模板/非白名单 new 都算有副作用)。sort 等原生调用
668
+ * 次数取决于算法内部的内建,仅在该 facet 在场时才真执行回调比较——
669
+ * 副作用回调多执行不可回滚(外层绑定 n++ 会错定值)。
670
+ */
671
+ effectFree?: boolean;
672
+ /**
673
+ * R3:transpile 静态判定的「封闭」facet(保守):体内所有标识符引用只
674
+ * 绑定自身形参/体内声明/纯全局白名单——不读任何外层可变态。
675
+ * promise then/catch 对 effectFree∧closed 回调允许同步执行:原生微任务
676
+ * 时刻 ≠ 同步时刻,只有不读外层态的回调两个时刻求值无差(`v => v + x`
677
+ * 读外层 x,同步执行会读到 drain 前旧值——假精确,须留在微任务路径)。
678
+ */
679
+ closed?: boolean;
659
680
  };
660
681
  declare function attachFnImpl(a: Abs, impl: AbsFnImpl): void;
661
682
  declare function getFnImpl(a: Abs): AbsFnImpl | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nudojs/core",
3
- "version": "1.11.3",
3
+ "version": "1.13.0",
4
4
  "engines": {
5
5
  "node": ">=20"
6
6
  },