@nudojs/core 1.15.0 → 1.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/exec.d.ts CHANGED
@@ -69,6 +69,7 @@ declare function $fnVal(params: string[], impl: (...args: Abs[]) => Abs, opts?:
69
69
  length?: number;
70
70
  effectFree?: boolean;
71
71
  closed?: boolean;
72
+ kind?: string;
72
73
  }): Abs;
73
74
  /**
74
75
  * 宿主 this → Abs:函数体 prologue 用它承接 call/apply/bind 传入的 thisArg。
@@ -490,6 +491,11 @@ declare function $forOf(iterable: Abs, body: (item: Abs, index: Abs) => void, ma
490
491
  * 即全量);仅异步可迭代(无 @@iterator 槽)的接收者不折同步槽位投影,
491
492
  * 元素取抽象 unknown(原生由 next() 链驱动)。 */
492
493
  forAwait?: boolean;
494
+ /** for-in(Bug 98):接收者重查 thunk——快照键进体前重查在场,体内
495
+ * delete 的未访问键跳过该迭代(与原生 EnumerateObjectProperties 的
496
+ * 逐键 [[GetOwnProperty]] 回查一致)。thunk 每迭代重读当前绑定,
497
+ * `delete o.k` 的写回(o = $del(o, k))经闭包变量可见。 */
498
+ forInRecv?: () => Abs;
493
499
  }): void;
494
500
  /**
495
501
  * Map/Set forEach:条目表逐条调用回调(value, key, recv)。
@@ -1017,6 +1023,15 @@ declare function $setSuperStatic(thisVal: Abs, childName: string, key: Abs, valu
1017
1023
 
1018
1024
  /** 实例方法调用:沿继承链;类 Abs 上回落 staticMethods;obj 上回落属性函数 */
1019
1025
  declare function $invoke(thisVal: Abs, method: string, args: Abs[], loc?: [number, number]): Abs;
1026
+ /** obj[key]():计算键成员调用(键运行时求值)。键折叠成槽名后走 $invoke
1027
+ * 既有派发;@@iterator 键按接收者形态折迭代器对象。键不可折叠(抽象键 /
1028
+ * 用户 symbol)→ 诚实 unknown(与 $call 对 unknown callee 同口径——
1029
+ * unknown 是 fail-closed 令牌,不记 may-throw)。 */
1030
+ declare function $invokeKey(thisVal: Abs, key: Abs, args: Abs[], loc?: [number, number]): Abs;
1031
+ /** 可选链计算键调用(a?.[k]() / a[k]?.() 的非链路径):nullish 接收者
1032
+ * 短路 undefined 字面量($optionalInvoke 同口径);键折叠与派发同
1033
+ * $invokeKey。 */
1034
+ declare function $optionalInvokeKey(thisVal: Abs, key: Abs, args: Abs[]): Abs;
1020
1035
 
1021
1036
  /**
1022
1037
  * this/可选链/静态成员读写:$thisGet/$thisSet/$optionalGet/$staticInvoke/$setKey。
@@ -1048,9 +1063,12 @@ declare function $setKey(o: Abs, key: Abs, value: Abs): Abs;
1048
1063
  */
1049
1064
 
1050
1065
  /**
1051
- * 语句级 RegExp 状态写回(test/exec):执行并把 lastIndex 更新后的 brand
1066
+ * 语句级 RegExp 状态写回(test/exec/compile):执行并把状态更新后的 brand
1052
1067
  * 返回给 transpile 重绑($reStateCall 与 $arrMutContainer 同模式)。
1053
1068
  * 表达式位置不写回($invoke 只读执行,调用方按 JS 语义先取值)。
1069
+ * Bug 96:match/replace/replaceAll 臂是**参数位**消费的语句位写回(模式
1070
+ * 作为 String 方法实参,spec @@match/@replace 对原正则 Set lastIndex)。
1071
+ * Bug 126:compile 臂重建接收者(值通道 $invoke→execRegexBrand 同一助手)。
1054
1072
  */
1055
1073
  declare function $reStateCall(re: Abs, method: string, args: Abs[]): Abs;
1056
1074
 
@@ -1074,4 +1092,4 @@ declare class NudoUnsupportedError extends Error {
1074
1092
  detail?: string);
1075
1093
  }
1076
1094
 
1077
- 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 };
1095
+ 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, $invokeKey, $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, $optionalInvokeKey, $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
@@ -49,6 +49,7 @@ import {
49
49
  $instanceof,
50
50
  $instanceofNonIdent,
51
51
  $invoke,
52
+ $invokeKey,
52
53
  $invokeSuper,
53
54
  $invokeSuperKey,
54
55
  $invokeSuperObj,
@@ -81,6 +82,7 @@ import {
81
82
  $objRest,
82
83
  $optionalGet,
83
84
  $optionalInvoke,
85
+ $optionalInvokeKey,
84
86
  $orDefault,
85
87
  $pow,
86
88
  $pushLoopExit,
@@ -206,7 +208,7 @@ import {
206
208
  withAssumePremises,
207
209
  withEvalBudgetOverride,
208
210
  withExecPhi
209
- } from "./chunk-NUTYUT3I.js";
211
+ } from "./chunk-WKIRPUHZ.js";
210
212
  export {
211
213
  $absVal,
212
214
  $add,
@@ -257,6 +259,7 @@ export {
257
259
  $instanceof,
258
260
  $instanceofNonIdent,
259
261
  $invoke,
262
+ $invokeKey,
260
263
  $invokeSuper,
261
264
  $invokeSuperKey,
262
265
  $invokeSuperObj,
@@ -289,6 +292,7 @@ export {
289
292
  $objRest,
290
293
  $optionalGet,
291
294
  $optionalInvoke,
295
+ $optionalInvokeKey,
292
296
  $orDefault,
293
297
  $pow,
294
298
  $pushLoopExit,
package/dist/index.d.ts CHANGED
@@ -408,8 +408,18 @@ declare function evalMathMethod(name: string, args: Abs[]): Abs | undefined;
408
408
  * 侧表派发(getter 读折返回体、setter 写走侧表不误抛 writable:false);
409
409
  * 描述符字段语义 = 新建属性缺省 false、已有属性仅显式 false 收紧;
410
410
  * open/index 标记与 invariants/accessor 侧表随不可变更新迁移。
411
+ * - Bug 86:tuple 接收者不再静默丢弃——下标键逐位装(增长段 hole、
412
+ * 空描述符清 hole)、length 键截断/延长(非法 RangeError)、
413
+ * {writable:false} length 以 sealed 近似、frozen 相同值重定义放行。
414
+ * - Bug 117:opts.symbolKey 沿用键的 symbol 投影标记("@@X");
415
+ * wellKnownSymbolSlotKey 供 defineProperty/defineProperties 实参投影。
416
+ * - Bug 118:value 字段直取槽中 Abs 落槽(不经 litValue 往返——
417
+ * fn/obj/tuple/bigint/symbol 值不再丢成「无 value 描述符」)。
411
418
  * - readProperty 是反射/枚举内建 [[Get]] 统一入口:accessorTable thunk
412
419
  * 优先(getter 求值)、数据槽兜底、setter-only 读 undefined。
420
+ * - classifyAssignSet(Bug 128)是 Object.assign 逐键 [[Set]] 单一分类:
421
+ * 自有访问器 setter / __proto__ 原型 setter(null|对象设原型、原始值
422
+ * 忽略、抽象 open)/ 自有·继承非可写定抛 / 其余建自有键。
413
423
  *
414
424
  * 兄弟模块边界:methods.ts(evalObjectMethod)经导出复用安装机器;
415
425
  * readProperty 供 json.ts(stringify 读值)。
@@ -808,6 +818,16 @@ type MapTable = {
808
818
  byLit: Map<LitKey, Abs>;
809
819
  /** 非字面量 key 写入的值(get 未知 key 时 join 用) */
810
820
  shadowValues: Abs[];
821
+ /**
822
+ * Bug 88:身份键条目(同一非字面量值——对象/函数/brand/any 绑定——
823
+ * 重复写不重复计数)。键不可字面量化但有可判身份(identKeyOf),
824
+ * size/keys/entries 仍可折 exact;无身份键的非字面量写入仍走
825
+ * shadowValues(size 保守)。
826
+ */
827
+ identEntries: Array<{
828
+ key: Abs;
829
+ value: Abs;
830
+ }>;
811
831
  /** 抽象分支并入后「可能不存在」的字面量键(get/has 需保守) */
812
832
  maybeAbsent?: Set<LitKey>;
813
833
  };
@@ -860,11 +880,14 @@ declare function makeMapAbs(iterable?: Abs): Abs;
860
880
  declare function makeSetAbs(iterable?: Abs): Abs;
861
881
  /** Map#set:fork 内写 overlay;否则原地。返回同一 Abs(JS 可变语义) */
862
882
  declare function mapSetEntry(mapAbs: Abs, key: Abs | undefined, value: Abs): Abs;
863
- /** Map#delete:fork overlay 内移除字面量键;未知 key 仅标 shadow 不确定 */
883
+ /** Map#delete:fork overlay 内移除字面量键;未知 key 仅标 shadow 不确定。
884
+ * Bug 88:引用身份键删除可精确命中(同引用条目移除)/精确 miss(键域全
885
+ * 特定且无 shadow 时)。any/unknown 等无引用身份的抽象键删除 → 身份条目
886
+ * 降级 shadow(键可能就是任一身份键,size/get 回保守)。 */
864
887
  declare function mapDeleteEntry(mapAbs: Abs, key: Abs | undefined): Abs;
865
888
  /** Map#clear:清空条目;fork 下仍走 overlay */
866
889
  declare function mapClearEntries(mapAbs: Abs): Abs;
867
- /** Map#get:命中字面量 key → 精确;miss / 未知 key / maybeAbsent / shadow 并 undefined */
890
+ /** Map#get:命中字面量/身份 key → 精确;miss / 未知 key / maybeAbsent / shadow 并 undefined */
868
891
  declare function mapGetEntry(mapAbs: Abs, key: Abs | undefined): Abs;
869
892
  /** Map#has:字面量 miss 折 exact false 时,get 必须是 undefined(不可再并 value) */
870
893
  declare function mapHasEntry(mapAbs: Abs, key: Abs | undefined): Abs;
@@ -877,9 +900,12 @@ declare function mapValuesAbs(mapAbs: Abs): Abs[];
877
900
  declare function mapEntriesAbs(mapAbs: Abs): Abs[];
878
901
  /** Set#add:fork 内写 overlay;返回同一 Abs */
879
902
  declare function setAddEntry(setAbs: Abs, value: Abs): Abs;
880
- /** Set#delete:按字面量元素移除;fork overlay 内生效。
903
+ /** Set#delete:按字面量/身份元素移除;fork overlay 内生效。
881
904
  * 字面量删除且无残留非字面量元素 → 该臂可精确 miss;
882
- * 臂间分歧由 endCollectionFork 按元素数差标 maybeAbsent。 */
905
+ * 臂间分歧由 endCollectionFork 按元素数差标 maybeAbsent。
906
+ * Bug 88:身份删除按绑定级身份匹配(s.add(x); s.delete(x) 同绑定必命中);
907
+ * 「无残留不确定元素」的精确 miss 判定用引用级身份——any/unknown 元素
908
+ * 原生可能恰为被删字面量/查询引用,不得当特定值。 */
883
909
  declare function setDeleteEntry(setAbs: Abs, value: Abs): Abs;
884
910
  /** Set#clear */
885
911
  declare function setClearEntries(setAbs: Abs): Abs;
package/dist/index.js CHANGED
@@ -74,7 +74,7 @@ import {
74
74
  takeInterfaceDiagsSince,
75
75
  takeRefineDiags,
76
76
  takeRefineDiagsSince
77
- } from "./chunk-47UPDZHE.js";
77
+ } from "./chunk-NXZSRLCT.js";
78
78
  import {
79
79
  $add,
80
80
  $arguments,
@@ -536,7 +536,7 @@ import {
536
536
  withExecPhi,
537
537
  withInvariantSpecs,
538
538
  withVar
539
- } from "./chunk-NUTYUT3I.js";
539
+ } from "./chunk-WKIRPUHZ.js";
540
540
 
541
541
  // src/environment.ts
542
542
  function createEnvironment(parent, bindings = /* @__PURE__ */ new Map()) {
package/dist/internal.js CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  stableAnalyzeKeySource,
23
23
  stablePathKey,
24
24
  stablePathKeyGraph
25
- } from "./chunk-47UPDZHE.js";
25
+ } from "./chunk-NXZSRLCT.js";
26
26
  import {
27
27
  $tryDigestSoft,
28
28
  $tryMarkSoft,
@@ -172,7 +172,7 @@ import {
172
172
  withEvalBudgetOverride,
173
173
  withFnBudgetOverride,
174
174
  wrapPromise
175
- } from "./chunk-NUTYUT3I.js";
175
+ } from "./chunk-WKIRPUHZ.js";
176
176
 
177
177
  // src/algebra/inlay.ts
178
178
  function listFunctions(source) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nudojs/core",
3
- "version": "1.15.0",
3
+ "version": "1.15.2",
4
4
  "engines": {
5
5
  "node": ">=22"
6
6
  },