@nudojs/core 1.11.1 → 1.11.3
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/{chunk-5VGO4YJT.js → chunk-2PFT7GU2.js} +1 -1
- package/dist/{chunk-YRRR6AWI.js → chunk-GL6VOF75.js} +416 -117
- package/dist/exec.d.ts +14 -4
- package/dist/exec.js +1 -1
- package/dist/index.d.ts +12 -4
- package/dist/index.js +64 -21
- package/dist/internal.d.ts +28 -7
- package/dist/internal.js +2 -2
- package/dist/{projection-budget-B0c9KEhd.d.ts → projection-budget-CeoxA06q.d.ts} +19 -1
- package/dist/{run-dg1bW60I.d.ts → run-DaqGgSre.d.ts} +2 -0
- package/package.json +1 -1
|
@@ -3301,7 +3301,7 @@ function coerceToStringParts(a) {
|
|
|
3301
3301
|
}
|
|
3302
3302
|
if (a.shape.k === "obj" && !a.shape.open && !a.shape.index && !isNullProtoObj(a)) {
|
|
3303
3303
|
const slots = a.shape.slots;
|
|
3304
|
-
if (!Object.hasOwn(slots, "toString") && !Object.hasOwn(slots, "valueOf")) {
|
|
3304
|
+
if (!Object.hasOwn(slots, "toString") && !Object.hasOwn(slots, "valueOf") && !Object.hasOwn(slots, "@@toPrimitive")) {
|
|
3305
3305
|
return [
|
|
3306
3306
|
abs({ k: "prim", type: "string" }, lit("[object Object]"), void 0, "exact")
|
|
3307
3307
|
];
|
|
@@ -4186,7 +4186,9 @@ function getPropFlags(o) {
|
|
|
4186
4186
|
}
|
|
4187
4187
|
function enumOwnKeys(o, slots) {
|
|
4188
4188
|
const flags = getPropFlags(o);
|
|
4189
|
-
return Object.keys(slots).filter(
|
|
4189
|
+
return Object.keys(slots).filter(
|
|
4190
|
+
(k) => flags?.get(k)?.enumerable !== false && slots[k]?.internal !== true
|
|
4191
|
+
);
|
|
4190
4192
|
}
|
|
4191
4193
|
function isEnumerableView(o, key) {
|
|
4192
4194
|
return getPropFlags(o)?.get(key)?.enumerable !== false;
|
|
@@ -4792,17 +4794,35 @@ var _activeCallKeys = [];
|
|
|
4792
4794
|
var _fnCallIds = /* @__PURE__ */ new WeakMap();
|
|
4793
4795
|
var _fnCallIdSeq = 0;
|
|
4794
4796
|
var _callTruncated = false;
|
|
4797
|
+
var _cycleTruncated = false;
|
|
4798
|
+
var _loopTruncated = false;
|
|
4799
|
+
var _truncReasons = /* @__PURE__ */ new Set();
|
|
4800
|
+
function noteLoopTruncation(label) {
|
|
4801
|
+
_loopTruncated = true;
|
|
4802
|
+
noteAbsTruncation(label);
|
|
4803
|
+
}
|
|
4795
4804
|
var _callDepthLimit = MAX_CALL_DEPTH;
|
|
4796
4805
|
var _totalCallsLimit = MAX_TOTAL_CALLS;
|
|
4806
|
+
var _evalCallProbe = null;
|
|
4807
|
+
function registerEvalCallBudgetProbe(probe) {
|
|
4808
|
+
_evalCallProbe = probe;
|
|
4809
|
+
}
|
|
4797
4810
|
function getAbsCallBudgetStats() {
|
|
4811
|
+
const b = _evalCallProbe?.stats();
|
|
4798
4812
|
return {
|
|
4799
4813
|
calls: _absTotalCalls,
|
|
4800
4814
|
maxCalls: _totalCallsLimit,
|
|
4801
|
-
forks:
|
|
4815
|
+
forks: _evalForkObsCount,
|
|
4802
4816
|
maxForks: _evalForkBudgetLimit,
|
|
4803
4817
|
callTruncated: _callTruncated,
|
|
4804
4818
|
forkTruncated: _evalForkTruncNoted,
|
|
4805
|
-
truncated: _callTruncated || _evalForkTruncNoted
|
|
4819
|
+
truncated: _callTruncated || (b?.callTruncated ?? false) || _evalForkTruncNoted || _loopTruncated,
|
|
4820
|
+
evalCalls: b?.calls ?? 0,
|
|
4821
|
+
maxEvalCalls: b?.maxCalls ?? MAX_TOTAL_CALLS,
|
|
4822
|
+
evalCallTruncated: b?.callTruncated ?? false,
|
|
4823
|
+
cycleTruncated: _cycleTruncated || (b?.cycleTruncated ?? false),
|
|
4824
|
+
loopTruncated: _loopTruncated,
|
|
4825
|
+
reasons: [..._truncReasons].sort()
|
|
4806
4826
|
};
|
|
4807
4827
|
}
|
|
4808
4828
|
function resetAbsCallBudget() {
|
|
@@ -4810,8 +4830,12 @@ function resetAbsCallBudget() {
|
|
|
4810
4830
|
_absTotalCalls = 0;
|
|
4811
4831
|
_activeCallKeys = [];
|
|
4812
4832
|
_callTruncated = false;
|
|
4833
|
+
_cycleTruncated = false;
|
|
4834
|
+
_loopTruncated = false;
|
|
4835
|
+
_truncReasons = /* @__PURE__ */ new Set();
|
|
4813
4836
|
_callDepthLimit = MAX_CALL_DEPTH;
|
|
4814
4837
|
_totalCallsLimit = MAX_TOTAL_CALLS;
|
|
4838
|
+
_evalCallProbe?.resetObservability();
|
|
4815
4839
|
resetEvalForkBudget();
|
|
4816
4840
|
}
|
|
4817
4841
|
function withFnBudgetOverride(budget, run) {
|
|
@@ -4862,18 +4886,21 @@ function setAbsTruncationCollector(collector) {
|
|
|
4862
4886
|
absTruncCollectorSlot.set(collector);
|
|
4863
4887
|
return prev;
|
|
4864
4888
|
}
|
|
4865
|
-
function noteAbsTruncation(label) {
|
|
4889
|
+
function noteAbsTruncation(label, reason) {
|
|
4890
|
+
if (reason) _truncReasons.add(reason);
|
|
4866
4891
|
const absTruncCollector = absTruncCollectorSlot.get();
|
|
4867
4892
|
if (!absTruncCollector) return;
|
|
4868
4893
|
try {
|
|
4869
|
-
absTruncCollector(label);
|
|
4894
|
+
absTruncCollector(label, reason);
|
|
4870
4895
|
} catch {
|
|
4871
4896
|
}
|
|
4872
4897
|
}
|
|
4873
4898
|
function enterCall(key, label) {
|
|
4874
|
-
|
|
4899
|
+
const reason = _activeCallKeys.includes(key) ? "cycle" : _absCallDepth >= _callDepthLimit ? "depth" : _absTotalCalls >= _totalCallsLimit ? "calls" : void 0;
|
|
4900
|
+
if (reason) {
|
|
4875
4901
|
_callTruncated = true;
|
|
4876
|
-
|
|
4902
|
+
if (reason === "cycle") _cycleTruncated = true;
|
|
4903
|
+
noteAbsTruncation(label, reason);
|
|
4877
4904
|
return false;
|
|
4878
4905
|
}
|
|
4879
4906
|
_activeCallKeys.push(key);
|
|
@@ -4888,6 +4915,7 @@ function exitCall() {
|
|
|
4888
4915
|
var MAX_EVAL_TOTAL_FORKS = 5e3;
|
|
4889
4916
|
var _evalForkBudgetLimit = MAX_EVAL_TOTAL_FORKS;
|
|
4890
4917
|
var _evalForkCount = 0;
|
|
4918
|
+
var _evalForkObsCount = 0;
|
|
4891
4919
|
var _evalForkTruncNoted = false;
|
|
4892
4920
|
var FORK_TRUNCATION_LABEL = "#fork-budget";
|
|
4893
4921
|
var HOST_EFFECT_LABEL_PREFIX = "#host-effect:";
|
|
@@ -4914,11 +4942,16 @@ function getEvalForkBudgetLimit() {
|
|
|
4914
4942
|
function getEvalForkCount() {
|
|
4915
4943
|
return _evalForkCount;
|
|
4916
4944
|
}
|
|
4917
|
-
function
|
|
4945
|
+
function resetEvalForkCount() {
|
|
4918
4946
|
_evalForkCount = 0;
|
|
4947
|
+
}
|
|
4948
|
+
function resetEvalForkBudget() {
|
|
4949
|
+
resetEvalForkCount();
|
|
4919
4950
|
_evalForkTruncNoted = false;
|
|
4951
|
+
_evalForkObsCount = 0;
|
|
4920
4952
|
}
|
|
4921
4953
|
function bumpEvalForkBudget() {
|
|
4954
|
+
_evalForkObsCount++;
|
|
4922
4955
|
if (++_evalForkCount <= _evalForkBudgetLimit) return true;
|
|
4923
4956
|
if (!_evalForkTruncNoted) {
|
|
4924
4957
|
_evalForkTruncNoted = true;
|
|
@@ -4980,6 +5013,71 @@ function classNameOfValue(v2) {
|
|
|
4980
5013
|
return classValues.get(v2);
|
|
4981
5014
|
}
|
|
4982
5015
|
|
|
5016
|
+
// src/algebra/exec/class-registry.ts
|
|
5017
|
+
var classRegistry = /* @__PURE__ */ new Map();
|
|
5018
|
+
var classEpoch = 0;
|
|
5019
|
+
var classEpochs = /* @__PURE__ */ new Map();
|
|
5020
|
+
var classCollisions = [];
|
|
5021
|
+
function beginClassEpoch() {
|
|
5022
|
+
classEpoch++;
|
|
5023
|
+
}
|
|
5024
|
+
function drainClassCollisions() {
|
|
5025
|
+
return classCollisions.splice(0, classCollisions.length);
|
|
5026
|
+
}
|
|
5027
|
+
function specShape(spec) {
|
|
5028
|
+
const ctorName = spec.ctor?.name ?? "anon";
|
|
5029
|
+
const methods = Object.keys(spec.methods ?? {}).sort().join(",");
|
|
5030
|
+
const statics = Object.keys(spec.staticMethods ?? {}).sort().join(",");
|
|
5031
|
+
const accessors = Object.keys(spec.accessors ?? {}).sort().join(",");
|
|
5032
|
+
const fields = Object.keys(spec.statics ?? {}).sort().join(",");
|
|
5033
|
+
const instFields = (spec.instanceFields ?? []).map((f) => f.name ?? "<computed>").sort().join(",");
|
|
5034
|
+
return `${ctorName}[${methods}](${statics}){${accessors}}{${fields}}{${instFields}}`;
|
|
5035
|
+
}
|
|
5036
|
+
function registerEvalClass(spec) {
|
|
5037
|
+
const prev = classRegistry.get(spec.name);
|
|
5038
|
+
const prevEpoch = classEpochs.get(spec.name);
|
|
5039
|
+
if (prev && prev !== spec && // 同 epoch(同一次 run 内)注册两次才可能是真碰撞:
|
|
5040
|
+
// 块级作用域同名类。跨 epoch = 顺序重注册(常态)。
|
|
5041
|
+
prevEpoch === classEpoch && specShape(prev) !== specShape(spec)) {
|
|
5042
|
+
classCollisions.push({
|
|
5043
|
+
name: spec.name,
|
|
5044
|
+
previous: specShape(prev),
|
|
5045
|
+
next: specShape(spec)
|
|
5046
|
+
});
|
|
5047
|
+
}
|
|
5048
|
+
classRegistry.set(spec.name, spec);
|
|
5049
|
+
classEpochs.set(spec.name, classEpoch);
|
|
5050
|
+
}
|
|
5051
|
+
function getEvalClass(name) {
|
|
5052
|
+
return classRegistry.get(name);
|
|
5053
|
+
}
|
|
5054
|
+
function classInstanceInnerOf(a) {
|
|
5055
|
+
const s = a.shape;
|
|
5056
|
+
if (s.k !== "brand") return void 0;
|
|
5057
|
+
if (classNameOfValue(a) === s.name) return void 0;
|
|
5058
|
+
if (!classRegistry.has(s.name)) return void 0;
|
|
5059
|
+
const inner = s.shape;
|
|
5060
|
+
const is = inner.shape;
|
|
5061
|
+
if (is.k !== "obj" || is.open || is.index) return void 0;
|
|
5062
|
+
return inner;
|
|
5063
|
+
}
|
|
5064
|
+
function classChainHasJsonUserFace(name) {
|
|
5065
|
+
let cur = name;
|
|
5066
|
+
const seen = /* @__PURE__ */ new Set();
|
|
5067
|
+
while (cur && !seen.has(cur)) {
|
|
5068
|
+
seen.add(cur);
|
|
5069
|
+
const spec = classRegistry.get(cur);
|
|
5070
|
+
if (spec?.methods?.["toJSON"]) return true;
|
|
5071
|
+
cur = spec?.superName;
|
|
5072
|
+
}
|
|
5073
|
+
return false;
|
|
5074
|
+
}
|
|
5075
|
+
function clearBClasses() {
|
|
5076
|
+
classRegistry.clear();
|
|
5077
|
+
classEpochs.clear();
|
|
5078
|
+
classCollisions.length = 0;
|
|
5079
|
+
}
|
|
5080
|
+
|
|
4983
5081
|
// src/algebra/builtins/json.ts
|
|
4984
5082
|
var NOT_LITERAL = /* @__PURE__ */ Symbol("nudo:not-literal");
|
|
4985
5083
|
var OMIT = /* @__PURE__ */ Symbol("nudo:json-omit");
|
|
@@ -5052,6 +5150,7 @@ function jsonStringifyTotal(a, seen = /* @__PURE__ */ new Set()) {
|
|
|
5052
5150
|
const flags = getPropFlags(a);
|
|
5053
5151
|
for (const [k, sv] of Object.entries(os.slots)) {
|
|
5054
5152
|
if (flags?.get(k)?.enumerable === false) continue;
|
|
5153
|
+
if (sv.internal === true) continue;
|
|
5055
5154
|
if (k === "toJSON" && sv.value.term?.op !== "lit") return false;
|
|
5056
5155
|
if (!jsonStringifyTotal(sv.value, seen)) return false;
|
|
5057
5156
|
}
|
|
@@ -5095,6 +5194,7 @@ function absToJsonNative(a, seen, valueMode) {
|
|
|
5095
5194
|
const flags = getPropFlags(a);
|
|
5096
5195
|
for (const [k, sv] of Object.entries(s.slots)) {
|
|
5097
5196
|
if (flags?.get(k)?.enumerable === false) continue;
|
|
5197
|
+
if (sv.internal === true) continue;
|
|
5098
5198
|
if (k === "toJSON") {
|
|
5099
5199
|
const ts = sv.value;
|
|
5100
5200
|
if (ts.term?.op !== "lit") return NOT_LITERAL;
|
|
@@ -5155,7 +5255,15 @@ function evalJsonMethod(name, args) {
|
|
|
5155
5255
|
if (name === "stringify") {
|
|
5156
5256
|
const a0Abs = args[0];
|
|
5157
5257
|
if (!a0Abs) return undefAbs();
|
|
5158
|
-
|
|
5258
|
+
let jsonArg = a0Abs;
|
|
5259
|
+
{
|
|
5260
|
+
const inner = classInstanceInnerOf(a0Abs);
|
|
5261
|
+
const brandName = a0Abs.shape.k === "brand" ? a0Abs.shape.name : void 0;
|
|
5262
|
+
if (inner && brandName !== void 0 && !classChainHasJsonUserFace(brandName)) {
|
|
5263
|
+
jsonArg = inner;
|
|
5264
|
+
}
|
|
5265
|
+
}
|
|
5266
|
+
const v2 = absToJsonNative(jsonArg, /* @__PURE__ */ new Set(), true);
|
|
5159
5267
|
if (v2 === NOT_LITERAL || v2 === OMIT) {
|
|
5160
5268
|
if (isNonJsonTopLevel(a0Abs)) return undefAbs();
|
|
5161
5269
|
if (v2 === NOT_LITERAL) {
|
|
@@ -6921,6 +7029,7 @@ function hasOwnDecision(recv, key) {
|
|
|
6921
7029
|
}
|
|
6922
7030
|
if (inner.shape.k === "obj") {
|
|
6923
7031
|
const slot = getSlot(inner.shape.slots, key);
|
|
7032
|
+
if (slot?.internal) return boolLit(false);
|
|
6924
7033
|
if (slot && !slot.optional) return boolLit(true);
|
|
6925
7034
|
if (slot?.optional) return boolPrimB();
|
|
6926
7035
|
if (!inner.shape.open) return boolLit(false);
|
|
@@ -6930,6 +7039,7 @@ function hasOwnDecision(recv, key) {
|
|
|
6930
7039
|
}
|
|
6931
7040
|
if (s.k === "obj") {
|
|
6932
7041
|
const slot = getSlot(s.slots, key);
|
|
7042
|
+
if (slot?.internal) return boolLit(false);
|
|
6933
7043
|
if (slot && !slot.optional) return boolLit(true);
|
|
6934
7044
|
if (slot?.optional) return boolPrimB();
|
|
6935
7045
|
if (!s.open && recv.conf === "exact") return boolLit(false);
|
|
@@ -8530,6 +8640,10 @@ function collectArrMutatorReceivers(node, acc = /* @__PURE__ */ new Set()) {
|
|
|
8530
8640
|
function isExpression(n) {
|
|
8531
8641
|
return n.type !== "PrivateName" && !n.type.endsWith("Statement") && !n.type.endsWith("Declaration");
|
|
8532
8642
|
}
|
|
8643
|
+
function privateNameKeySrc(prop) {
|
|
8644
|
+
const priv = prop.id?.name ?? prop.name;
|
|
8645
|
+
return priv ? JSON.stringify(`#${priv}`) : null;
|
|
8646
|
+
}
|
|
8533
8647
|
|
|
8534
8648
|
// src/algebra/exec/transpile/transpile-dispatch.ts
|
|
8535
8649
|
var dispatch = {};
|
|
@@ -10576,7 +10690,7 @@ function classSpecOf(stmt, depth, opts) {
|
|
|
10576
10690
|
if (!k?.type) return null;
|
|
10577
10691
|
if (!computed && k.type === "PrivateName") {
|
|
10578
10692
|
const n = k.id?.name ?? k.name;
|
|
10579
|
-
return n ? { name: `#${n}
|
|
10693
|
+
return n ? { name: `#${n}`, private: true } : null;
|
|
10580
10694
|
}
|
|
10581
10695
|
if (!computed && k.type === "Identifier" && k.name) return { name: k.name };
|
|
10582
10696
|
if (k.type === "StringLiteral" || k.type === "NumericLiteral") {
|
|
@@ -10630,7 +10744,7 @@ function classSpecOf(stmt, depth, opts) {
|
|
|
10630
10744
|
const initSrc = thunkOf(vsrc, depth + 2);
|
|
10631
10745
|
if (keyR2 && "name" in keyR2) {
|
|
10632
10746
|
instanceFieldParts.push(
|
|
10633
|
-
`${indent(depth + 2)}{ name: ${JSON.stringify(keyR2.name)}, init: ${initSrc} },`
|
|
10747
|
+
`${indent(depth + 2)}{ name: ${JSON.stringify(keyR2.name)}, init: ${initSrc}${keyR2.private === true ? ", private: true" : ""} },`
|
|
10634
10748
|
);
|
|
10635
10749
|
} else if (keyR2 && "computed" in keyR2) {
|
|
10636
10750
|
instanceFieldParts.push(
|
|
@@ -11291,6 +11405,18 @@ ${inner}
|
|
|
11291
11405
|
const r2 = isExpression(expr.right) ? transpileExpression(expr.right, opts) : "$lit(void 0)";
|
|
11292
11406
|
return `$instanceofNonIdent(${l2}, ${r2})`;
|
|
11293
11407
|
}
|
|
11408
|
+
if (expr.operator === "in" && expr.left.type === "PrivateName") {
|
|
11409
|
+
const key = privateNameKeySrc(
|
|
11410
|
+
expr.left
|
|
11411
|
+
);
|
|
11412
|
+
if (!key) {
|
|
11413
|
+
throw new NudoUnsupportedError(
|
|
11414
|
+
`binary:in-private`,
|
|
11415
|
+
expr.loc ? { line: expr.loc.start.line, column: expr.loc.start.column } : void 0
|
|
11416
|
+
);
|
|
11417
|
+
}
|
|
11418
|
+
return `$in($lit(${key}), ${transpileExpression(expr.right, opts)})`;
|
|
11419
|
+
}
|
|
11294
11420
|
const fn2 = BIN_OPS[expr.operator];
|
|
11295
11421
|
if (!fn2) {
|
|
11296
11422
|
throw new NudoUnsupportedError(
|
|
@@ -11618,14 +11744,15 @@ ${mBodyInner}
|
|
|
11618
11744
|
}
|
|
11619
11745
|
if (expr.property.type === "PrivateName") {
|
|
11620
11746
|
const recv2 = transpileExpression(expr.object, opts);
|
|
11621
|
-
const
|
|
11622
|
-
|
|
11747
|
+
const key2 = privateNameKeySrc(
|
|
11748
|
+
expr.property
|
|
11749
|
+
);
|
|
11750
|
+
if (!key2) {
|
|
11623
11751
|
throw new NudoUnsupportedError(
|
|
11624
11752
|
`member:PrivateName`,
|
|
11625
11753
|
expr.loc ? { line: expr.loc.start.line, column: expr.loc.start.column } : void 0
|
|
11626
11754
|
);
|
|
11627
11755
|
}
|
|
11628
|
-
const key2 = JSON.stringify(`#${priv}`);
|
|
11629
11756
|
return optional ? `$optionalGet(${recv2}, ${key2})` : `$get(${recv2}, ${key2})`;
|
|
11630
11757
|
}
|
|
11631
11758
|
if (expr.property.type !== "Identifier") {
|
|
@@ -11747,14 +11874,18 @@ ${mBodyInner}
|
|
|
11747
11874
|
}
|
|
11748
11875
|
if (!m.computed && m.property.type === "PrivateName") {
|
|
11749
11876
|
const obj2 = transpileExpression(m.object, opts);
|
|
11750
|
-
const
|
|
11751
|
-
|
|
11877
|
+
const key = privateNameKeySrc(
|
|
11878
|
+
m.property
|
|
11879
|
+
);
|
|
11880
|
+
if (!key) {
|
|
11752
11881
|
throw new NudoUnsupportedError(
|
|
11753
11882
|
`assign-target`,
|
|
11754
11883
|
expr.loc ? { line: expr.loc.start.line, column: expr.loc.start.column } : void 0
|
|
11755
11884
|
);
|
|
11756
11885
|
}
|
|
11757
|
-
|
|
11886
|
+
const cur = `$get(${obj2}, ${key})`;
|
|
11887
|
+
const valSrc = compoundFn ? `${compoundFn}(${cur}, ${right})` : right;
|
|
11888
|
+
return `((__v) => (($set(${obj2}, ${key}, __v)), __v))(${valSrc})`;
|
|
11758
11889
|
}
|
|
11759
11890
|
if (!m.computed && m.property.type === "Identifier") {
|
|
11760
11891
|
const obj2 = transpileExpression(m.object, opts);
|
|
@@ -12613,50 +12744,6 @@ function noteObjSlotMissing(recv, name, loc) {
|
|
|
12613
12744
|
return true;
|
|
12614
12745
|
}
|
|
12615
12746
|
|
|
12616
|
-
// src/algebra/exec/class-registry.ts
|
|
12617
|
-
var classRegistry = /* @__PURE__ */ new Map();
|
|
12618
|
-
var classEpoch = 0;
|
|
12619
|
-
var classEpochs = /* @__PURE__ */ new Map();
|
|
12620
|
-
var classCollisions = [];
|
|
12621
|
-
function beginClassEpoch() {
|
|
12622
|
-
classEpoch++;
|
|
12623
|
-
}
|
|
12624
|
-
function drainClassCollisions() {
|
|
12625
|
-
return classCollisions.splice(0, classCollisions.length);
|
|
12626
|
-
}
|
|
12627
|
-
function specShape(spec) {
|
|
12628
|
-
const ctorName = spec.ctor?.name ?? "anon";
|
|
12629
|
-
const methods = Object.keys(spec.methods ?? {}).sort().join(",");
|
|
12630
|
-
const statics = Object.keys(spec.staticMethods ?? {}).sort().join(",");
|
|
12631
|
-
const accessors = Object.keys(spec.accessors ?? {}).sort().join(",");
|
|
12632
|
-
const fields = Object.keys(spec.statics ?? {}).sort().join(",");
|
|
12633
|
-
const instFields = (spec.instanceFields ?? []).map((f) => f.name ?? "<computed>").sort().join(",");
|
|
12634
|
-
return `${ctorName}[${methods}](${statics}){${accessors}}{${fields}}{${instFields}}`;
|
|
12635
|
-
}
|
|
12636
|
-
function registerEvalClass(spec) {
|
|
12637
|
-
const prev = classRegistry.get(spec.name);
|
|
12638
|
-
const prevEpoch = classEpochs.get(spec.name);
|
|
12639
|
-
if (prev && prev !== spec && // 同 epoch(同一次 run 内)注册两次才可能是真碰撞:
|
|
12640
|
-
// 块级作用域同名类。跨 epoch = 顺序重注册(常态)。
|
|
12641
|
-
prevEpoch === classEpoch && specShape(prev) !== specShape(spec)) {
|
|
12642
|
-
classCollisions.push({
|
|
12643
|
-
name: spec.name,
|
|
12644
|
-
previous: specShape(prev),
|
|
12645
|
-
next: specShape(spec)
|
|
12646
|
-
});
|
|
12647
|
-
}
|
|
12648
|
-
classRegistry.set(spec.name, spec);
|
|
12649
|
-
classEpochs.set(spec.name, classEpoch);
|
|
12650
|
-
}
|
|
12651
|
-
function getEvalClass(name) {
|
|
12652
|
-
return classRegistry.get(name);
|
|
12653
|
-
}
|
|
12654
|
-
function clearBClasses() {
|
|
12655
|
-
classRegistry.clear();
|
|
12656
|
-
classEpochs.clear();
|
|
12657
|
-
classCollisions.length = 0;
|
|
12658
|
-
}
|
|
12659
|
-
|
|
12660
12747
|
// src/algebra/exec/runtime/members.ts
|
|
12661
12748
|
function $objAccessorKey(o, key, get, set) {
|
|
12662
12749
|
const pk = propertyKeyOf(key);
|
|
@@ -14774,7 +14861,18 @@ function $spread(a, b) {
|
|
|
14774
14861
|
}
|
|
14775
14862
|
}
|
|
14776
14863
|
const aa = asAbsVal(a);
|
|
14777
|
-
|
|
14864
|
+
let b0 = bb;
|
|
14865
|
+
{
|
|
14866
|
+
const ciInner = classInstanceInnerOf(b0);
|
|
14867
|
+
if (ciInner) {
|
|
14868
|
+
const ciSlots = ciInner.shape.slots;
|
|
14869
|
+
const pub = {};
|
|
14870
|
+
for (const k of enumOwnKeys(ciInner, ciSlots)) {
|
|
14871
|
+
setSlot(pub, k, getSlot(ciSlots, k));
|
|
14872
|
+
}
|
|
14873
|
+
b0 = abs({ k: "obj", slots: pub }, void 0, void 0, b0.conf);
|
|
14874
|
+
}
|
|
14875
|
+
}
|
|
14778
14876
|
if (aa?.shape?.k === "any" || b0?.shape?.k === "any") {
|
|
14779
14877
|
const base = spread(
|
|
14780
14878
|
aa?.shape?.k === "any" ? abs({ k: "obj", slots: {}, open: true }, void 0, void 0, "partial") : aa,
|
|
@@ -15197,7 +15295,7 @@ function $forOf(iterable, body, maxIters = DEFAULT_MAX_LOOP_ITERS, opts) {
|
|
|
15197
15295
|
}
|
|
15198
15296
|
if (unbounded && n === 0) snapExit();
|
|
15199
15297
|
if (concreteOverrun) {
|
|
15200
|
-
|
|
15298
|
+
noteLoopTruncation(LOOP_TRUNCATION_LABEL);
|
|
15201
15299
|
if (pack && unpack) unpack(confPartialPacked(pack()));
|
|
15202
15300
|
return;
|
|
15203
15301
|
}
|
|
@@ -15576,7 +15674,7 @@ function $collectionForEach(recv, cb) {
|
|
|
15576
15674
|
}
|
|
15577
15675
|
return void 0;
|
|
15578
15676
|
}
|
|
15579
|
-
function $set(o, key, value) {
|
|
15677
|
+
function $set(o, key, value, opts) {
|
|
15580
15678
|
privateNameGuard(o, key);
|
|
15581
15679
|
if (!o || typeof o !== "object" || !("shape" in o)) {
|
|
15582
15680
|
return o;
|
|
@@ -15601,12 +15699,16 @@ function $set(o, key, value) {
|
|
|
15601
15699
|
throwStrictWrite();
|
|
15602
15700
|
}
|
|
15603
15701
|
if (getPropFlags(o)?.get(key)?.writable === false) throwStrictWrite();
|
|
15604
|
-
|
|
15702
|
+
const prevSlot2 = getSlot(inner2.shape.slots, key);
|
|
15703
|
+
setSlot(inner2.shape.slots, key, {
|
|
15704
|
+
value: asAbsVal(value),
|
|
15705
|
+
...prevSlot2?.internal || opts?.internal ? { internal: true } : {}
|
|
15706
|
+
});
|
|
15605
15707
|
clearStaleTermPred(o);
|
|
15606
15708
|
return o;
|
|
15607
15709
|
}
|
|
15608
15710
|
}
|
|
15609
|
-
const inner = $set(o.shape.shape, key, value);
|
|
15711
|
+
const inner = $set(o.shape.shape, key, value, opts);
|
|
15610
15712
|
const next = abs(
|
|
15611
15713
|
{ k: "brand", name: o.shape.name, shape: inner },
|
|
15612
15714
|
o.term,
|
|
@@ -15701,7 +15803,11 @@ function $set(o, key, value) {
|
|
|
15701
15803
|
if (key === "__proto__" && !isNullProtoObj(o)) {
|
|
15702
15804
|
return $setProto(o, value);
|
|
15703
15805
|
}
|
|
15704
|
-
|
|
15806
|
+
const prevSlot = getSlot(shape2.slots, key);
|
|
15807
|
+
setSlot(shape2.slots, key, {
|
|
15808
|
+
value: asAbsVal(value),
|
|
15809
|
+
...prevSlot?.internal || opts?.internal ? { internal: true } : {}
|
|
15810
|
+
});
|
|
15705
15811
|
o.conf = confJoin(o.conf, value.conf);
|
|
15706
15812
|
clearStaleTermPred(o);
|
|
15707
15813
|
return o;
|
|
@@ -15992,7 +16098,7 @@ function $for(init, test, step, body, maxIters = DEFAULT_MAX_LOOP_ITERS, opts) {
|
|
|
15992
16098
|
snapCounter();
|
|
15993
16099
|
snapExt();
|
|
15994
16100
|
if (concreteExhausted) {
|
|
15995
|
-
|
|
16101
|
+
noteLoopTruncation(LOOP_TRUNCATION_LABEL);
|
|
15996
16102
|
if (extJoin && pack && unpack) unpack(confPartialPacked(widenLoopJoin(joinAbs(extJoin, pack()))));
|
|
15997
16103
|
return confPartial(exitJoin ?? state);
|
|
15998
16104
|
}
|
|
@@ -16081,7 +16187,7 @@ function $while(init, test, step, maxIters = DEFAULT_MAX_LOOP_ITERS) {
|
|
|
16081
16187
|
}
|
|
16082
16188
|
}
|
|
16083
16189
|
if (concreteExhausted) {
|
|
16084
|
-
|
|
16190
|
+
noteLoopTruncation(LOOP_TRUNCATION_LABEL);
|
|
16085
16191
|
return confPartial(exitJoin ? joinAbs(exitJoin, state) : state);
|
|
16086
16192
|
}
|
|
16087
16193
|
return exitJoin ? widen.widenFinal(joinAbs(exitJoin, state)) : state;
|
|
@@ -16144,7 +16250,7 @@ function $whileSeq(test, body, maxIters = DEFAULT_MAX_LOOP_ITERS, opts) {
|
|
|
16144
16250
|
}
|
|
16145
16251
|
snapExit();
|
|
16146
16252
|
if (concreteExhausted) {
|
|
16147
|
-
|
|
16253
|
+
noteLoopTruncation(LOOP_TRUNCATION_LABEL);
|
|
16148
16254
|
if (exitJoin && pack && unpack) unpack(confPartialPacked(joinAbs(exitJoin, pack())));
|
|
16149
16255
|
return;
|
|
16150
16256
|
}
|
|
@@ -17761,6 +17867,22 @@ var evalCallDepthLimit = MAX_EVAL_CALL_DEPTH;
|
|
|
17761
17867
|
var evalTotalCallsLimit = MAX_EVAL_TOTAL_CALLS;
|
|
17762
17868
|
var evalFnCallIds = /* @__PURE__ */ new WeakMap();
|
|
17763
17869
|
var evalFnCallIdSeq = 0;
|
|
17870
|
+
var evalObsCalls = 0;
|
|
17871
|
+
var evalObsCallTruncated = false;
|
|
17872
|
+
var evalObsCycleTruncated = false;
|
|
17873
|
+
registerEvalCallBudgetProbe({
|
|
17874
|
+
stats: () => ({
|
|
17875
|
+
calls: evalObsCalls,
|
|
17876
|
+
maxCalls: evalTotalCallsLimit,
|
|
17877
|
+
callTruncated: evalObsCallTruncated,
|
|
17878
|
+
cycleTruncated: evalObsCycleTruncated
|
|
17879
|
+
}),
|
|
17880
|
+
resetObservability: () => {
|
|
17881
|
+
evalObsCalls = 0;
|
|
17882
|
+
evalObsCallTruncated = false;
|
|
17883
|
+
evalObsCycleTruncated = false;
|
|
17884
|
+
}
|
|
17885
|
+
});
|
|
17764
17886
|
function evalStableId(obj2) {
|
|
17765
17887
|
let id = evalFnCallIds.get(obj2);
|
|
17766
17888
|
if (id === void 0) {
|
|
@@ -17776,6 +17898,9 @@ function resetEvalCallBudget() {
|
|
|
17776
17898
|
evalBudgetSessionDepth = 0;
|
|
17777
17899
|
evalCallDepthLimit = MAX_EVAL_CALL_DEPTH;
|
|
17778
17900
|
evalTotalCallsLimit = MAX_EVAL_TOTAL_CALLS;
|
|
17901
|
+
evalObsCalls = 0;
|
|
17902
|
+
evalObsCallTruncated = false;
|
|
17903
|
+
evalObsCycleTruncated = false;
|
|
17779
17904
|
resetEvalForkBudget();
|
|
17780
17905
|
clearPureMemo();
|
|
17781
17906
|
clearPureCallMemo();
|
|
@@ -17801,7 +17926,7 @@ function enterEvalCallBudgetSession() {
|
|
|
17801
17926
|
evalCallDepth = 0;
|
|
17802
17927
|
evalTotalCalls = 0;
|
|
17803
17928
|
evalActiveCallKeys = [];
|
|
17804
|
-
|
|
17929
|
+
resetEvalForkCount();
|
|
17805
17930
|
}
|
|
17806
17931
|
evalBudgetSessionDepth++;
|
|
17807
17932
|
}
|
|
@@ -17825,13 +17950,17 @@ function evalCallBudgetKey(name, fn2, args) {
|
|
|
17825
17950
|
}
|
|
17826
17951
|
function evalEnterCall(name, fn2, args) {
|
|
17827
17952
|
const key = evalCallBudgetKey(name, fn2, args);
|
|
17828
|
-
|
|
17829
|
-
|
|
17953
|
+
const reason = evalActiveCallKeys.includes(key) ? "cycle" : evalCallDepth >= evalCallDepthLimit ? "depth" : evalTotalCalls >= evalTotalCallsLimit ? "calls" : void 0;
|
|
17954
|
+
if (reason) {
|
|
17955
|
+
evalObsCallTruncated = true;
|
|
17956
|
+
if (reason === "cycle") evalObsCycleTruncated = true;
|
|
17957
|
+
noteAbsTruncation(name, reason);
|
|
17830
17958
|
return { ok: false };
|
|
17831
17959
|
}
|
|
17832
17960
|
evalActiveCallKeys.push(key);
|
|
17833
17961
|
evalCallDepth++;
|
|
17834
17962
|
evalTotalCalls++;
|
|
17963
|
+
evalObsCalls++;
|
|
17835
17964
|
return { ok: true, key };
|
|
17836
17965
|
}
|
|
17837
17966
|
function evalExitCall() {
|
|
@@ -18844,7 +18973,7 @@ function applyInstanceFields(spec, thisVal) {
|
|
|
18844
18973
|
}
|
|
18845
18974
|
}
|
|
18846
18975
|
if (!key) continue;
|
|
18847
|
-
cur = $set(cur, key, asAbsVal(f.init(cur)));
|
|
18976
|
+
cur = $set(cur, key, asAbsVal(f.init(cur)), { internal: f.private === true });
|
|
18848
18977
|
}
|
|
18849
18978
|
return cur;
|
|
18850
18979
|
}
|
|
@@ -20160,13 +20289,68 @@ function invokeArrMethod(arr, method, args) {
|
|
|
20160
20289
|
);
|
|
20161
20290
|
}
|
|
20162
20291
|
if (method === "concat") {
|
|
20292
|
+
const argObjShapeOf = (v2) => {
|
|
20293
|
+
const s = v2.shape;
|
|
20294
|
+
if (s.k === "obj") return s;
|
|
20295
|
+
if (s.k === "brand" && s.shape.shape.k === "obj") return s.shape.shape;
|
|
20296
|
+
return void 0;
|
|
20297
|
+
};
|
|
20298
|
+
const spreadableOf = (v2) => {
|
|
20299
|
+
const o = argObjShapeOf(v2);
|
|
20300
|
+
const slot = o ? getSlot(o.slots, "@@isConcatSpreadable") : void 0;
|
|
20301
|
+
if (!slot) return "absent";
|
|
20302
|
+
const lv = litValue(slot.value);
|
|
20303
|
+
if (!lv.ok) return "abstract";
|
|
20304
|
+
const w = lv.value;
|
|
20305
|
+
if (w === void 0 || w === null || w === false || w === "" || w === 0n || typeof w === "number" && (w === 0 || Number.isNaN(w))) {
|
|
20306
|
+
return "false";
|
|
20307
|
+
}
|
|
20308
|
+
return "true";
|
|
20309
|
+
};
|
|
20310
|
+
const spreadElsOf = (v2) => {
|
|
20311
|
+
const o = argObjShapeOf(v2);
|
|
20312
|
+
if (!o) return null;
|
|
20313
|
+
const lenAbs = getSlot(o.slots, "length")?.value;
|
|
20314
|
+
if (!lenAbs || isNullishLitAbs(lenAbs)) return [];
|
|
20315
|
+
const lv = litValue(lenAbs);
|
|
20316
|
+
if (!lv.ok || typeof lv.value !== "number") return null;
|
|
20317
|
+
const t = Math.trunc(lv.value);
|
|
20318
|
+
if (t > TUPLE_MATERIALIZE_CAP) return null;
|
|
20319
|
+
const n = t < 0 ? 0 : t;
|
|
20320
|
+
const els = [];
|
|
20321
|
+
for (let i = 0; i < n; i++) els.push(getSlot(o.slots, String(i))?.value ?? undefAbs());
|
|
20322
|
+
return els;
|
|
20323
|
+
};
|
|
20324
|
+
const spreadPossiblesOf = (v2) => {
|
|
20325
|
+
const o = argObjShapeOf(v2);
|
|
20326
|
+
const parts2 = [v2, undefAbs()];
|
|
20327
|
+
if (o) {
|
|
20328
|
+
for (const [k, s] of Object.entries(o.slots)) {
|
|
20329
|
+
if (canonicalArrayIndex(k) !== void 0) parts2.push(s.value);
|
|
20330
|
+
}
|
|
20331
|
+
if (o.index) parts2.push(o.index.value);
|
|
20332
|
+
}
|
|
20333
|
+
return parts2.reduce((x, y) => joinAbs(x, y));
|
|
20334
|
+
};
|
|
20163
20335
|
if (shape2.k === "tuple") {
|
|
20164
20336
|
const out = [...shape2.elements];
|
|
20165
20337
|
const holesC = new Set(holes);
|
|
20166
20338
|
let degraded = false;
|
|
20167
20339
|
for (const a of args) {
|
|
20168
20340
|
const aa = asAbs(a) ?? unknown;
|
|
20169
|
-
|
|
20341
|
+
const spread2 = spreadableOf(aa);
|
|
20342
|
+
if (spread2 === "true") {
|
|
20343
|
+
const els = spreadElsOf(aa);
|
|
20344
|
+
if (els === null) {
|
|
20345
|
+
out.push(spreadPossiblesOf(aa));
|
|
20346
|
+
degraded = true;
|
|
20347
|
+
} else out.push(...els);
|
|
20348
|
+
} else if (spread2 === "false") {
|
|
20349
|
+
out.push(aa);
|
|
20350
|
+
} else if (spread2 === "abstract") {
|
|
20351
|
+
out.push(spreadPossiblesOf(aa));
|
|
20352
|
+
degraded = true;
|
|
20353
|
+
} else if (aa.shape.k === "tuple") {
|
|
20170
20354
|
const argHoles = aa.shape.holes ?? [];
|
|
20171
20355
|
const base = out.length;
|
|
20172
20356
|
for (let i = 0; i < aa.shape.elements.length; i++) {
|
|
@@ -20194,10 +20378,26 @@ function invokeArrMethod(arr, method, args) {
|
|
|
20194
20378
|
confJoin(arr.conf, "path")
|
|
20195
20379
|
);
|
|
20196
20380
|
}
|
|
20197
|
-
const parts = [shape2.element
|
|
20381
|
+
const parts = [shape2.element];
|
|
20382
|
+
for (const a of args) {
|
|
20198
20383
|
const aa = asAbs(a) ?? unknown;
|
|
20199
|
-
|
|
20200
|
-
|
|
20384
|
+
const spread2 = spreadableOf(aa);
|
|
20385
|
+
if (spread2 === "true") {
|
|
20386
|
+
const els = spreadElsOf(aa);
|
|
20387
|
+
if (els === null) parts.push(spreadPossiblesOf(aa));
|
|
20388
|
+
else parts.push(...els);
|
|
20389
|
+
} else if (spread2 === "false") {
|
|
20390
|
+
parts.push(aa);
|
|
20391
|
+
} else if (spread2 === "abstract") {
|
|
20392
|
+
parts.push(spreadPossiblesOf(aa));
|
|
20393
|
+
} else if (aa.shape.k === "arr") {
|
|
20394
|
+
parts.push(aa.shape.element);
|
|
20395
|
+
} else if (aa.shape.k === "tuple") {
|
|
20396
|
+
parts.push(
|
|
20397
|
+
aa.shape.elements.length ? aa.shape.elements.reduce((x, y) => joinAbs(x, y)) : unknown
|
|
20398
|
+
);
|
|
20399
|
+
} else parts.push(aa);
|
|
20400
|
+
}
|
|
20201
20401
|
return abs(
|
|
20202
20402
|
{ k: "arr", element: parts.reduce((x, y) => joinAbs(x, y)) },
|
|
20203
20403
|
void 0,
|
|
@@ -22113,6 +22313,16 @@ function assignSourceSlots(src) {
|
|
|
22113
22313
|
}
|
|
22114
22314
|
return void 0;
|
|
22115
22315
|
}
|
|
22316
|
+
{
|
|
22317
|
+
const inner = classInstanceInnerOf(src);
|
|
22318
|
+
if (inner) {
|
|
22319
|
+
const slots = {};
|
|
22320
|
+
for (const k of enumOwnKeys(inner, inner.shape.slots)) {
|
|
22321
|
+
setSlot(slots, k, getSlot(inner.shape.slots, k));
|
|
22322
|
+
}
|
|
22323
|
+
return slots;
|
|
22324
|
+
}
|
|
22325
|
+
}
|
|
22116
22326
|
if (s.k === "prim") return s.type === "string" ? void 0 : {};
|
|
22117
22327
|
if (s.k === "eff" || s.k === "never") return {};
|
|
22118
22328
|
return void 0;
|
|
@@ -22427,9 +22637,15 @@ function evalObjectMethod(name, args) {
|
|
|
22427
22637
|
const enumKeys = (slots, target) => {
|
|
22428
22638
|
const flags = getPropFlags(target);
|
|
22429
22639
|
return Object.keys(slots).filter(
|
|
22430
|
-
(k) => flags?.get(k)?.enumerable !== false
|
|
22640
|
+
(k) => flags?.get(k)?.enumerable !== false && slots[k]?.internal !== true
|
|
22431
22641
|
);
|
|
22432
22642
|
};
|
|
22643
|
+
const classInstanceEnumEntries = (a02) => {
|
|
22644
|
+
const inner = a02 ? classInstanceInnerOf(a02) : void 0;
|
|
22645
|
+
if (!inner) return void 0;
|
|
22646
|
+
const slots = inner.shape.slots;
|
|
22647
|
+
return enumOwnKeys(inner, slots).map((k) => [k, getSlot(slots, k).value]);
|
|
22648
|
+
};
|
|
22433
22649
|
switch (name) {
|
|
22434
22650
|
case "create": {
|
|
22435
22651
|
if (a0 === void 0 || a0.term?.op === "lit" && a0.term.value === void 0) {
|
|
@@ -22530,6 +22746,10 @@ function evalObjectMethod(name, args) {
|
|
|
22530
22746
|
if (builtinBrandNoEnumKeys(a0)) {
|
|
22531
22747
|
return abs({ k: "tuple", elements: [] }, void 0, void 0, "exact");
|
|
22532
22748
|
}
|
|
22749
|
+
const ciKeys = classInstanceEnumEntries(a0);
|
|
22750
|
+
if (ciKeys) {
|
|
22751
|
+
return abs({ k: "tuple", elements: ciKeys.map(([k]) => strLit(k)) }, void 0, void 0, "exact");
|
|
22752
|
+
}
|
|
22533
22753
|
}
|
|
22534
22754
|
noteRecvMayNullish(a0, "Object.keys receiver ToObject");
|
|
22535
22755
|
return abs({ k: "arr", element: str2("path") }, void 0, void 0, "partial");
|
|
@@ -22584,6 +22804,10 @@ function evalObjectMethod(name, args) {
|
|
|
22584
22804
|
if (builtinBrandNoEnumKeys(a0)) {
|
|
22585
22805
|
return abs({ k: "tuple", elements: [] }, void 0, void 0, "exact");
|
|
22586
22806
|
}
|
|
22807
|
+
const ciVals = classInstanceEnumEntries(a0);
|
|
22808
|
+
if (ciVals) {
|
|
22809
|
+
return abs({ k: "tuple", elements: ciVals.map(([, v2]) => v2) }, void 0, void 0, "exact");
|
|
22810
|
+
}
|
|
22587
22811
|
}
|
|
22588
22812
|
noteRecvMayNullish(a0, "Object.values receiver ToObject");
|
|
22589
22813
|
return abs({ k: "arr", element: unknown }, void 0, void 0, "partial");
|
|
@@ -22661,6 +22885,20 @@ function evalObjectMethod(name, args) {
|
|
|
22661
22885
|
if (builtinBrandNoEnumKeys(a0)) {
|
|
22662
22886
|
return abs({ k: "tuple", elements: [] }, void 0, void 0, "exact");
|
|
22663
22887
|
}
|
|
22888
|
+
const ciEntries = classInstanceEnumEntries(a0);
|
|
22889
|
+
if (ciEntries) {
|
|
22890
|
+
return abs(
|
|
22891
|
+
{
|
|
22892
|
+
k: "tuple",
|
|
22893
|
+
elements: ciEntries.map(
|
|
22894
|
+
([k, v2]) => abs({ k: "tuple", elements: [strLit(k), v2] }, void 0, void 0, "exact")
|
|
22895
|
+
)
|
|
22896
|
+
},
|
|
22897
|
+
void 0,
|
|
22898
|
+
void 0,
|
|
22899
|
+
"exact"
|
|
22900
|
+
);
|
|
22901
|
+
}
|
|
22664
22902
|
}
|
|
22665
22903
|
noteRecvMayNullish(a0, "Object.entries receiver ToObject");
|
|
22666
22904
|
return abs({ k: "arr", element: unknown }, void 0, void 0, "partial");
|
|
@@ -22676,10 +22914,24 @@ function evalObjectMethod(name, args) {
|
|
|
22676
22914
|
if (typeof key !== "string") return boolPrim();
|
|
22677
22915
|
if (a0.shape.k === "obj") {
|
|
22678
22916
|
const shape2 = a0.shape;
|
|
22917
|
+
if (shape2.slots[key]?.internal === true) {
|
|
22918
|
+
return boolLit(false);
|
|
22919
|
+
}
|
|
22679
22920
|
if (Object.prototype.hasOwnProperty.call(shape2.slots, key)) return boolLit(true);
|
|
22680
22921
|
if (!shape2.open && a0.conf === "exact") return boolLit(false);
|
|
22681
22922
|
return boolPrim();
|
|
22682
22923
|
}
|
|
22924
|
+
{
|
|
22925
|
+
const inner = classInstanceInnerOf(a0);
|
|
22926
|
+
if (inner) {
|
|
22927
|
+
const slots = inner.shape.slots;
|
|
22928
|
+
const slot = getSlot(slots, key);
|
|
22929
|
+
if (slot?.internal) return boolLit(false);
|
|
22930
|
+
if (slot && !slot.optional) return boolLit(true);
|
|
22931
|
+
if (slot?.optional) return boolPrim();
|
|
22932
|
+
return boolLit(false);
|
|
22933
|
+
}
|
|
22934
|
+
}
|
|
22683
22935
|
return boolPrim();
|
|
22684
22936
|
}
|
|
22685
22937
|
case "getPrototypeOf": {
|
|
@@ -22912,6 +23164,7 @@ function evalObjectMethod(name, args) {
|
|
|
22912
23164
|
if (os.open || os.index) {
|
|
22913
23165
|
const slots = {};
|
|
22914
23166
|
for (const key of Object.keys(os.slots)) {
|
|
23167
|
+
if (os.slots[key]?.internal === true) continue;
|
|
22915
23168
|
const value = os.slots[key].value;
|
|
22916
23169
|
const flags = getPropFlags(a0)?.get(key);
|
|
22917
23170
|
slots[key] = {
|
|
@@ -22925,9 +23178,7 @@ function evalObjectMethod(name, args) {
|
|
|
22925
23178
|
}
|
|
22926
23179
|
return abs({ k: "obj", slots, open: true }, void 0, void 0, "partial");
|
|
22927
23180
|
}
|
|
22928
|
-
const entries = Object.keys(os.slots).map(
|
|
22929
|
-
(key) => [key, os.slots[key].value]
|
|
22930
|
-
);
|
|
23181
|
+
const entries = Object.keys(os.slots).filter((key) => os.slots[key]?.internal !== true).map((key) => [key, os.slots[key].value]);
|
|
22931
23182
|
const flagsMap = getPropFlags(a0);
|
|
22932
23183
|
return descSlotsOf(entries, (key) => {
|
|
22933
23184
|
const f = flagsMap?.get(key);
|
|
@@ -23003,12 +23254,28 @@ function evalObjectMethod(name, args) {
|
|
|
23003
23254
|
if (builtinBrandNoEnumKeys(a0)) {
|
|
23004
23255
|
return abs({ k: "tuple", elements: [] }, void 0, void 0, "exact");
|
|
23005
23256
|
}
|
|
23257
|
+
{
|
|
23258
|
+
const inner2 = classInstanceInnerOf(a0);
|
|
23259
|
+
if (inner2) {
|
|
23260
|
+
const os = inner2.shape;
|
|
23261
|
+
const names = Object.keys(os.slots).filter((k) => os.slots[k].internal !== true);
|
|
23262
|
+
return abs(
|
|
23263
|
+
{ k: "tuple", elements: names.map((n) => strLit(n)) },
|
|
23264
|
+
void 0,
|
|
23265
|
+
void 0,
|
|
23266
|
+
"exact"
|
|
23267
|
+
);
|
|
23268
|
+
}
|
|
23269
|
+
}
|
|
23006
23270
|
}
|
|
23007
23271
|
if (a0.shape.k === "obj") {
|
|
23008
23272
|
const os = a0.shape;
|
|
23009
23273
|
if (!os.open && !os.index) {
|
|
23010
23274
|
return abs(
|
|
23011
|
-
{
|
|
23275
|
+
{
|
|
23276
|
+
k: "tuple",
|
|
23277
|
+
elements: Object.keys(os.slots).filter((n) => os.slots[n]?.internal !== true).map((n) => strLit(n))
|
|
23278
|
+
},
|
|
23012
23279
|
void 0,
|
|
23013
23280
|
void 0,
|
|
23014
23281
|
"exact"
|
|
@@ -23045,39 +23312,45 @@ function evalObjectMethod(name, args) {
|
|
|
23045
23312
|
const key = typeof kv === "string" || typeof kv === "number" ? String(kv) : void 0;
|
|
23046
23313
|
const mkDesc = mkPropDescAbs;
|
|
23047
23314
|
const maybeDesc = maybePropDescAbs;
|
|
23315
|
+
const accessorDescOf = (target, key2) => {
|
|
23316
|
+
const acc = lookupObjAccessor(target, key2);
|
|
23317
|
+
if (!acc) return void 0;
|
|
23318
|
+
const flags = getPropFlags(target)?.get(key2);
|
|
23319
|
+
const wrapGet = (thunk) => absFunction(["_this"], {
|
|
23320
|
+
body: noBody,
|
|
23321
|
+
apply: (_args, thisVal) => thunk(thisVal ?? target)
|
|
23322
|
+
});
|
|
23323
|
+
const wrapSet = (thunk) => absFunction(["_this", "value"], {
|
|
23324
|
+
body: noBody,
|
|
23325
|
+
apply: (args2, thisVal) => {
|
|
23326
|
+
thunk(thisVal ?? target, args2[0] ?? undefAbs());
|
|
23327
|
+
return undefAbs();
|
|
23328
|
+
}
|
|
23329
|
+
});
|
|
23330
|
+
return abs(
|
|
23331
|
+
{
|
|
23332
|
+
k: "obj",
|
|
23333
|
+
slots: {
|
|
23334
|
+
get: { value: acc.get ? wrapGet(acc.get) : undefAbs() },
|
|
23335
|
+
set: { value: acc.set ? wrapSet(acc.set) : undefAbs() },
|
|
23336
|
+
enumerable: { value: boolLit(flags?.enumerable !== false) },
|
|
23337
|
+
configurable: { value: boolLit(flags?.configurable !== false) }
|
|
23338
|
+
}
|
|
23339
|
+
},
|
|
23340
|
+
void 0,
|
|
23341
|
+
void 0,
|
|
23342
|
+
"exact"
|
|
23343
|
+
);
|
|
23344
|
+
};
|
|
23048
23345
|
if (a0.shape.k === "obj") {
|
|
23049
23346
|
const os = a0.shape;
|
|
23050
23347
|
if (os.open || os.index || key === void 0) return maybeDesc();
|
|
23348
|
+
if (os.slots[key]?.internal === true) {
|
|
23349
|
+
return undefAbs();
|
|
23350
|
+
}
|
|
23051
23351
|
if (Object.prototype.hasOwnProperty.call(os.slots, key)) {
|
|
23052
|
-
const
|
|
23053
|
-
if (
|
|
23054
|
-
const flags2 = getPropFlags(a0)?.get(key);
|
|
23055
|
-
const wrapGet = (thunk) => absFunction(["_this"], {
|
|
23056
|
-
body: noBody,
|
|
23057
|
-
apply: (_args, thisVal) => thunk(thisVal ?? a0)
|
|
23058
|
-
});
|
|
23059
|
-
const wrapSet = (thunk) => absFunction(["_this", "value"], {
|
|
23060
|
-
body: noBody,
|
|
23061
|
-
apply: (args2, thisVal) => {
|
|
23062
|
-
thunk(thisVal ?? a0, args2[0] ?? undefAbs());
|
|
23063
|
-
return undefAbs();
|
|
23064
|
-
}
|
|
23065
|
-
});
|
|
23066
|
-
return abs(
|
|
23067
|
-
{
|
|
23068
|
-
k: "obj",
|
|
23069
|
-
slots: {
|
|
23070
|
-
get: { value: acc.get ? wrapGet(acc.get) : undefAbs() },
|
|
23071
|
-
set: { value: acc.set ? wrapSet(acc.set) : undefAbs() },
|
|
23072
|
-
enumerable: { value: boolLit(flags2?.enumerable !== false) },
|
|
23073
|
-
configurable: { value: boolLit(flags2?.configurable !== false) }
|
|
23074
|
-
}
|
|
23075
|
-
},
|
|
23076
|
-
void 0,
|
|
23077
|
-
void 0,
|
|
23078
|
-
"exact"
|
|
23079
|
-
);
|
|
23080
|
-
}
|
|
23352
|
+
const accDesc = accessorDescOf(a0, key);
|
|
23353
|
+
if (accDesc) return accDesc;
|
|
23081
23354
|
const flags = getPropFlags(a0)?.get(key);
|
|
23082
23355
|
return mkDesc(
|
|
23083
23356
|
readProperty(a0, key),
|
|
@@ -23089,6 +23362,27 @@ function evalObjectMethod(name, args) {
|
|
|
23089
23362
|
if (a0.conf === "exact") return undefAbs();
|
|
23090
23363
|
return maybeDesc();
|
|
23091
23364
|
}
|
|
23365
|
+
{
|
|
23366
|
+
const inner = classInstanceInnerOf(a0);
|
|
23367
|
+
if (inner && key !== void 0) {
|
|
23368
|
+
const slots = inner.shape.slots;
|
|
23369
|
+
if (slots[key]?.internal === true) {
|
|
23370
|
+
return undefAbs();
|
|
23371
|
+
}
|
|
23372
|
+
if (Object.prototype.hasOwnProperty.call(slots, key)) {
|
|
23373
|
+
const accDesc = accessorDescOf(inner, key);
|
|
23374
|
+
if (accDesc) return accDesc;
|
|
23375
|
+
const flags = getPropFlags(a0)?.get(key);
|
|
23376
|
+
return mkDesc(
|
|
23377
|
+
slots[key].value,
|
|
23378
|
+
flags?.writable !== false,
|
|
23379
|
+
flags?.enumerable !== false,
|
|
23380
|
+
flags?.configurable !== false
|
|
23381
|
+
);
|
|
23382
|
+
}
|
|
23383
|
+
return undefAbs();
|
|
23384
|
+
}
|
|
23385
|
+
}
|
|
23092
23386
|
if (a0.shape.k === "tuple" && key !== void 0) {
|
|
23093
23387
|
const holes = a0.shape.holes ?? [];
|
|
23094
23388
|
if (key === "length") {
|
|
@@ -23728,11 +24022,15 @@ function errorBrandAbs(name, args) {
|
|
|
23728
24022
|
const cause = Object.prototype.hasOwnProperty.call(optionsArg.shape.slots, "cause") ? optionsArg.shape.slots["cause"].value : undefAbs();
|
|
23729
24023
|
slots["cause"] = { value: cause };
|
|
23730
24024
|
}
|
|
24025
|
+
const errInner = objOf(slots);
|
|
24026
|
+
for (const k of Object.keys(slots)) {
|
|
24027
|
+
setPropFlags(errInner, k, { enumerable: false });
|
|
24028
|
+
}
|
|
23731
24029
|
return abs(
|
|
23732
24030
|
{
|
|
23733
24031
|
k: "brand",
|
|
23734
24032
|
name,
|
|
23735
|
-
shape:
|
|
24033
|
+
shape: errInner
|
|
23736
24034
|
},
|
|
23737
24035
|
void 0,
|
|
23738
24036
|
void 0,
|
|
@@ -26222,6 +26520,9 @@ export {
|
|
|
26222
26520
|
resetEvalForkBudget,
|
|
26223
26521
|
bumpEvalForkBudget,
|
|
26224
26522
|
evalMathMethod,
|
|
26523
|
+
registerEvalClass,
|
|
26524
|
+
getEvalClass,
|
|
26525
|
+
clearBClasses,
|
|
26225
26526
|
evalJsonMethod,
|
|
26226
26527
|
evalNumberStatic,
|
|
26227
26528
|
makeArrayCtorAbs,
|
|
@@ -26337,9 +26638,6 @@ export {
|
|
|
26337
26638
|
isEvalMissingSlotEnabled,
|
|
26338
26639
|
runWithEvalMissingSlot,
|
|
26339
26640
|
noteObjSlotMissing,
|
|
26340
|
-
registerEvalClass,
|
|
26341
|
-
getEvalClass,
|
|
26342
|
-
clearBClasses,
|
|
26343
26641
|
$objAccessorKey,
|
|
26344
26642
|
$in,
|
|
26345
26643
|
$instanceof,
|
|
@@ -26348,6 +26646,7 @@ export {
|
|
|
26348
26646
|
$delRes,
|
|
26349
26647
|
$del,
|
|
26350
26648
|
DEFAULT_MAX_LOOP_ITERS,
|
|
26649
|
+
LOOP_TRUNCATION_LABEL,
|
|
26351
26650
|
defineClass,
|
|
26352
26651
|
getClass,
|
|
26353
26652
|
getClassChain,
|