@neocompose/cli 0.89.8 → 0.89.10
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/CHANGELOG.md +19 -0
- package/dist/neo-runtime.mjs +1713 -483
- package/dist/test-worker.mjs +263 -44
- package/package.json +1 -1
- package/skills/neocompose-cli/SKILL.md +1 -1
- package/skills/neocompose-cli/references/cli-development.md +1 -1
- package/skills/neocompose-cli/references/declarations/constructors.md +20 -0
- package/skills/neocompose-cli/references/declarations/declarations.md +3 -0
- package/skills/neocompose-cli/references/neoscript/collections.md +2 -0
- package/skills/neocompose-cli/references/neoscript/delegates-and-listeners.md +2 -0
- package/skills/neocompose-cli/references/values/identities.md +9 -8
- package/skills/neocompose-cli/references/world/variants.md +28 -2
package/dist/neo-runtime.mjs
CHANGED
|
@@ -7354,42 +7354,6 @@ function descendantClassIdsInChildIndex(classId, childrenByClassId) {
|
|
|
7354
7354
|
}
|
|
7355
7355
|
return result;
|
|
7356
7356
|
}
|
|
7357
|
-
function addDependentMemberIds(memberIds, members2) {
|
|
7358
|
-
const childIdsByParentId = /* @__PURE__ */ new Map();
|
|
7359
|
-
const entryIdsByOwnerId = /* @__PURE__ */ new Map();
|
|
7360
|
-
const remainingOwnersByEntryId = /* @__PURE__ */ new Map();
|
|
7361
|
-
for (const member of members2) {
|
|
7362
|
-
if (member.extendsMemberId) {
|
|
7363
|
-
const children3 = childIdsByParentId.get(member.extendsMemberId);
|
|
7364
|
-
if (children3 === void 0) {
|
|
7365
|
-
childIdsByParentId.set(member.extendsMemberId, [member.id]);
|
|
7366
|
-
} else children3.push(member.id);
|
|
7367
|
-
}
|
|
7368
|
-
const entries = member.elementMemberIds ?? (member.entryMemberId ? [member.entryMemberId] : []);
|
|
7369
|
-
if (entries.length > 0) {
|
|
7370
|
-
entryIdsByOwnerId.set(member.id, entries);
|
|
7371
|
-
for (const entryId of entries)
|
|
7372
|
-
remainingOwnersByEntryId.set(
|
|
7373
|
-
entryId,
|
|
7374
|
-
(remainingOwnersByEntryId.get(entryId) ?? 0) + 1
|
|
7375
|
-
);
|
|
7376
|
-
}
|
|
7377
|
-
}
|
|
7378
|
-
const pending = [...memberIds];
|
|
7379
|
-
function include(memberId) {
|
|
7380
|
-
if (memberIds.has(memberId)) return;
|
|
7381
|
-
memberIds.add(memberId);
|
|
7382
|
-
pending.push(memberId);
|
|
7383
|
-
}
|
|
7384
|
-
for (let id2 = pending.pop(); id2 !== void 0; id2 = pending.pop()) {
|
|
7385
|
-
for (const childId of childIdsByParentId.get(id2) ?? []) include(childId);
|
|
7386
|
-
for (const entryId of entryIdsByOwnerId.get(id2) ?? []) {
|
|
7387
|
-
const remainingOwners = remainingOwnersByEntryId.get(entryId) - 1;
|
|
7388
|
-
remainingOwnersByEntryId.set(entryId, remainingOwners);
|
|
7389
|
-
if (remainingOwners === 0) include(entryId);
|
|
7390
|
-
}
|
|
7391
|
-
}
|
|
7392
|
-
}
|
|
7393
7357
|
var UnresolvedMemberInheritanceError, NO_CLASSES, NO_MEMBERS, resolvedClassSchemas;
|
|
7394
7358
|
var init_inheritance = __esm({
|
|
7395
7359
|
"../packages/models/src/classes/inheritance.ts"() {
|
|
@@ -19407,7 +19371,7 @@ var init_registry = __esm({
|
|
|
19407
19371
|
"../packages/manifest/schema-contract/registry.mjs"() {
|
|
19408
19372
|
"use strict";
|
|
19409
19373
|
PROJECT_SCHEMA_CONTRACT = Object.freeze({
|
|
19410
|
-
cliVersion: "0.89.
|
|
19374
|
+
cliVersion: "0.89.10",
|
|
19411
19375
|
projectFileUploadBatchSize: 32,
|
|
19412
19376
|
documentRecords: {
|
|
19413
19377
|
member: {
|
|
@@ -24412,7 +24376,7 @@ function mayUseLocalInitializer(text, names2) {
|
|
|
24412
24376
|
}
|
|
24413
24377
|
return false;
|
|
24414
24378
|
}
|
|
24415
|
-
function localInitializerUses(expression) {
|
|
24379
|
+
function localInitializerUses(expression, options = {}) {
|
|
24416
24380
|
const uses = [];
|
|
24417
24381
|
const pending = [
|
|
24418
24382
|
{ node: expression, owned: true, path: { parent: void 0, key: "" } }
|
|
@@ -24431,7 +24395,12 @@ function localInitializerUses(expression) {
|
|
|
24431
24395
|
const keys = [];
|
|
24432
24396
|
for (let step = path; step?.parent !== void 0; step = step.parent)
|
|
24433
24397
|
keys.push(step.key);
|
|
24434
|
-
uses.push({
|
|
24398
|
+
uses.push({
|
|
24399
|
+
node,
|
|
24400
|
+
owned,
|
|
24401
|
+
path: path === null ? null : keys.reverse(),
|
|
24402
|
+
...current.reference ? { reference: true } : {}
|
|
24403
|
+
});
|
|
24435
24404
|
break;
|
|
24436
24405
|
}
|
|
24437
24406
|
case "annotated":
|
|
@@ -24479,8 +24448,18 @@ function localInitializerUses(expression) {
|
|
|
24479
24448
|
}
|
|
24480
24449
|
break;
|
|
24481
24450
|
case "call":
|
|
24482
|
-
if (node.callee.kind === "ident" && node.callee.name === "Reference")
|
|
24451
|
+
if (node.callee.kind === "ident" && node.callee.name === "Reference") {
|
|
24452
|
+
if (options.includeReferences && node.args.length === 1 && node.args[0]?.kind === "ident" && node.argumentNames?.[0] == null) {
|
|
24453
|
+
pending.push({
|
|
24454
|
+
node: node.args[0],
|
|
24455
|
+
owned: false,
|
|
24456
|
+
path: null,
|
|
24457
|
+
bound,
|
|
24458
|
+
reference: true
|
|
24459
|
+
});
|
|
24460
|
+
}
|
|
24483
24461
|
break;
|
|
24462
|
+
}
|
|
24484
24463
|
add([node.callee, ...node.args], false);
|
|
24485
24464
|
break;
|
|
24486
24465
|
case "member":
|
|
@@ -24525,10 +24504,10 @@ function applyInitializerCodeSplices(code, splices) {
|
|
|
24525
24504
|
parts.push(code.slice(offset));
|
|
24526
24505
|
return parts.join("");
|
|
24527
24506
|
}
|
|
24528
|
-
function rewriteLocalInitializerUses(code, replace) {
|
|
24507
|
+
function rewriteLocalInitializerUses(code, replace, options = {}) {
|
|
24529
24508
|
const source = new SourceText(code);
|
|
24530
24509
|
const splices = [];
|
|
24531
|
-
for (const use of localInitializerUses(parseExpression(code))) {
|
|
24510
|
+
for (const use of localInitializerUses(parseExpression(code), options)) {
|
|
24532
24511
|
const text = replace(use);
|
|
24533
24512
|
if (text === null) continue;
|
|
24534
24513
|
const start = source.offsetAt({
|
|
@@ -24634,10 +24613,27 @@ function validateExecutableLocalUses(documents, localExpressions) {
|
|
|
24634
24613
|
}
|
|
24635
24614
|
}
|
|
24636
24615
|
if (locals.size === 0) return [];
|
|
24637
|
-
const
|
|
24616
|
+
const terminalNames = /* @__PURE__ */ new Map();
|
|
24617
|
+
const terminalName = (name) => {
|
|
24618
|
+
const chain = /* @__PURE__ */ new Set();
|
|
24619
|
+
let terminal2 = name;
|
|
24620
|
+
while (!chain.has(terminal2)) {
|
|
24621
|
+
const cached = terminalNames.get(terminal2);
|
|
24622
|
+
if (cached !== void 0) {
|
|
24623
|
+
terminal2 = cached;
|
|
24624
|
+
break;
|
|
24625
|
+
}
|
|
24626
|
+
chain.add(terminal2);
|
|
24627
|
+
const expression = localExpressions.get(terminal2);
|
|
24628
|
+
if (expression?.kind !== "ident" || !locals.has(expression.name)) break;
|
|
24629
|
+
terminal2 = expression.name;
|
|
24630
|
+
}
|
|
24631
|
+
for (const alias of chain) terminalNames.set(alias, terminal2);
|
|
24632
|
+
return terminal2;
|
|
24633
|
+
};
|
|
24638
24634
|
const uses = [];
|
|
24639
24635
|
const owners = /* @__PURE__ */ new Map();
|
|
24640
|
-
const add = (text, uri, origin, parent,
|
|
24636
|
+
const add = (text, uri, origin, parent, template = false, shadowed = /* @__PURE__ */ new Set()) => {
|
|
24641
24637
|
if (!mayUseLocalInitializer(text, locals)) return;
|
|
24642
24638
|
let expression;
|
|
24643
24639
|
try {
|
|
@@ -24645,10 +24641,8 @@ function validateExecutableLocalUses(documents, localExpressions) {
|
|
|
24645
24641
|
} catch {
|
|
24646
24642
|
return;
|
|
24647
24643
|
}
|
|
24648
|
-
if (parent !== void 0)
|
|
24649
|
-
|
|
24650
|
-
aliases.set(parent, expression.name);
|
|
24651
|
-
}
|
|
24644
|
+
if (parent !== void 0 && expression.kind === "ident" && locals.has(expression.name))
|
|
24645
|
+
return;
|
|
24652
24646
|
for (const { node, owned } of localInitializerUses(expression)) {
|
|
24653
24647
|
if (!locals.has(node.name) || shadowed.has(node.name)) continue;
|
|
24654
24648
|
const start = {
|
|
@@ -24661,14 +24655,14 @@ function validateExecutableLocalUses(documents, localExpressions) {
|
|
|
24661
24655
|
uri,
|
|
24662
24656
|
start,
|
|
24663
24657
|
parent,
|
|
24664
|
-
staticOwner: expression === node ? staticOwner : void 0,
|
|
24665
24658
|
template
|
|
24666
24659
|
};
|
|
24667
24660
|
uses.push(use);
|
|
24668
24661
|
if (owned) {
|
|
24669
|
-
const
|
|
24662
|
+
const terminal2 = terminalName(node.name);
|
|
24663
|
+
const entries = owners.get(terminal2) ?? [];
|
|
24670
24664
|
entries.push(use);
|
|
24671
|
-
owners.set(
|
|
24665
|
+
owners.set(terminal2, entries);
|
|
24672
24666
|
}
|
|
24673
24667
|
}
|
|
24674
24668
|
};
|
|
@@ -24684,7 +24678,6 @@ function validateExecutableLocalUses(documents, localExpressions) {
|
|
|
24684
24678
|
uri,
|
|
24685
24679
|
member.initializer.range.start,
|
|
24686
24680
|
void 0,
|
|
24687
|
-
isStatic ? `${declaration.name}.${member.name}` : void 0,
|
|
24688
24681
|
!isStatic,
|
|
24689
24682
|
new Set(
|
|
24690
24683
|
declaration.headerParameters?.map((parameter4) => parameter4.name)
|
|
@@ -24721,23 +24714,20 @@ function validateExecutableLocalUses(documents, localExpressions) {
|
|
|
24721
24714
|
const placements = /* @__PURE__ */ new Map();
|
|
24722
24715
|
const active = /* @__PURE__ */ new Set();
|
|
24723
24716
|
const placement = (name) => {
|
|
24717
|
+
name = terminalName(name);
|
|
24724
24718
|
const cached = placements.get(name);
|
|
24725
24719
|
if (cached !== void 0) return cached;
|
|
24726
|
-
if (active.has(name))
|
|
24727
|
-
return { count: 0, template: false, staticOwner: void 0 };
|
|
24720
|
+
if (active.has(name)) return { count: 0, template: false };
|
|
24728
24721
|
active.add(name);
|
|
24729
24722
|
const result = {
|
|
24730
24723
|
count: 0,
|
|
24731
|
-
template: false
|
|
24732
|
-
staticOwner: void 0
|
|
24724
|
+
template: false
|
|
24733
24725
|
};
|
|
24734
24726
|
for (const owner of owners.get(name) ?? []) {
|
|
24735
24727
|
const parent = owner.parent === void 0 ? void 0 : placement(owner.parent);
|
|
24736
24728
|
if (parent?.count === 0) continue;
|
|
24737
24729
|
result.count += parent?.count ?? 1;
|
|
24738
24730
|
result.template ||= parent?.template ?? owner.template;
|
|
24739
|
-
const alias = owner.parent !== void 0 && aliases.get(owner.parent) === name;
|
|
24740
|
-
result.staticOwner = alias ? parent?.staticOwner : owner.staticOwner;
|
|
24741
24731
|
if (result.count > 1) break;
|
|
24742
24732
|
}
|
|
24743
24733
|
active.delete(name);
|
|
@@ -24763,22 +24753,6 @@ function validateExecutableLocalUses(documents, localExpressions) {
|
|
|
24763
24753
|
if (declaration.kind === "enum") scalarTypes.add(declaration.name);
|
|
24764
24754
|
}
|
|
24765
24755
|
}
|
|
24766
|
-
const identities = /* @__PURE__ */ new Map();
|
|
24767
|
-
const resolving = /* @__PURE__ */ new Set();
|
|
24768
|
-
const hasIdentity = (name) => {
|
|
24769
|
-
const cached = identities.get(name);
|
|
24770
|
-
if (cached !== void 0) return cached;
|
|
24771
|
-
if (resolving.has(name)) return false;
|
|
24772
|
-
resolving.add(name);
|
|
24773
|
-
const alias = aliases.get(name);
|
|
24774
|
-
const expression = localExpressions.get(name);
|
|
24775
|
-
const identified = alias !== void 0 ? hasIdentity(alias) : locals.get(name).annotations.some((annotation2) => annotation2.name === "id") || expression?.kind === "annotated" && expression.annotations.some(
|
|
24776
|
-
(annotation2) => annotation2.name === "id"
|
|
24777
|
-
);
|
|
24778
|
-
resolving.delete(name);
|
|
24779
|
-
identities.set(name, identified);
|
|
24780
|
-
return identified;
|
|
24781
|
-
};
|
|
24782
24756
|
const reportedOwners = /* @__PURE__ */ new Set();
|
|
24783
24757
|
for (const use of uses) {
|
|
24784
24758
|
const declaration = locals.get(use.name);
|
|
@@ -24807,13 +24781,6 @@ function validateExecutableLocalUses(documents, localExpressions) {
|
|
|
24807
24781
|
);
|
|
24808
24782
|
continue;
|
|
24809
24783
|
}
|
|
24810
|
-
const hasId = hasIdentity(use.name);
|
|
24811
|
-
if (!hasId && owner.staticOwner === void 0) {
|
|
24812
|
-
report(
|
|
24813
|
-
use,
|
|
24814
|
-
`Local initializer ${use.name} has no stable instance identity. Keep an @id on its nested owning value, or place it directly in a static member before referencing it.`
|
|
24815
|
-
);
|
|
24816
|
-
}
|
|
24817
24784
|
if (owner.template) {
|
|
24818
24785
|
report(
|
|
24819
24786
|
use,
|
|
@@ -25265,6 +25232,7 @@ var init_local_values = __esm({
|
|
|
25265
25232
|
/** Static members whose initializer is a bare local name, by that name. */
|
|
25266
25233
|
ownerMembers = /* @__PURE__ */ new Map();
|
|
25267
25234
|
scalarTypes;
|
|
25235
|
+
pendingReferences = /* @__PURE__ */ new Map();
|
|
25268
25236
|
resolve(expression, source, valueId) {
|
|
25269
25237
|
if (expression.kind !== "ident") return { expression, source };
|
|
25270
25238
|
let text;
|
|
@@ -25331,12 +25299,55 @@ var init_local_values = __esm({
|
|
|
25331
25299
|
executable(code, runtimeIdentifiers = /* @__PURE__ */ new Set(), materializationRoot, identity3, storedValueAtPath) {
|
|
25332
25300
|
if (this.definitions.size === 0 || !mayUseLocalInitializer(code, this.definitions))
|
|
25333
25301
|
return { code, splices: [] };
|
|
25302
|
+
const terminalName = (name) => {
|
|
25303
|
+
this.inline(name);
|
|
25304
|
+
return this.terminalInitializers.get(name)?.global.name ?? name;
|
|
25305
|
+
};
|
|
25306
|
+
const owned = /* @__PURE__ */ new Set();
|
|
25307
|
+
const read = /* @__PURE__ */ new Set();
|
|
25308
|
+
const scanned = /* @__PURE__ */ new Set();
|
|
25309
|
+
const usedNames = new Set(runtimeIdentifiers);
|
|
25310
|
+
const scan = (text, runtimeNames) => {
|
|
25311
|
+
for (const match of text.matchAll(/[A-Za-z_]\w*/g))
|
|
25312
|
+
usedNames.add(match[0]);
|
|
25313
|
+
for (const use of localInitializerUses(
|
|
25314
|
+
parseCachedInitializer(this.syntax?.expressions, text),
|
|
25315
|
+
{ includeReferences: true }
|
|
25316
|
+
)) {
|
|
25317
|
+
if (!this.has(use.node.name) || runtimeNames.has(use.node.name))
|
|
25318
|
+
continue;
|
|
25319
|
+
const name = terminalName(use.node.name);
|
|
25320
|
+
if (!use.owned) {
|
|
25321
|
+
read.add(name);
|
|
25322
|
+
continue;
|
|
25323
|
+
}
|
|
25324
|
+
owned.add(name);
|
|
25325
|
+
if (scanned.has(name)) continue;
|
|
25326
|
+
scanned.add(name);
|
|
25327
|
+
scan(this.inline(name).text, /* @__PURE__ */ new Set());
|
|
25328
|
+
}
|
|
25329
|
+
};
|
|
25330
|
+
scan(code, runtimeIdentifiers);
|
|
25331
|
+
const shared = /* @__PURE__ */ new Map();
|
|
25332
|
+
for (const name of owned) {
|
|
25333
|
+
if (!read.has(name) || this.scalarTypes.has(this.definitions.get(name).type.name))
|
|
25334
|
+
continue;
|
|
25335
|
+
let variable2 = `__neo_owned_${shared.size}`;
|
|
25336
|
+
while (usedNames.has(variable2) || this.definitions.has(variable2) || runtimeIdentifiers.has(variable2))
|
|
25337
|
+
variable2 += "_";
|
|
25338
|
+
usedNames.add(variable2);
|
|
25339
|
+
shared.set(name, variable2);
|
|
25340
|
+
}
|
|
25341
|
+
const bindings = /* @__PURE__ */ new Map();
|
|
25334
25342
|
const active = /* @__PURE__ */ new Set();
|
|
25335
25343
|
const expand = (text, path, runtimeNames) => rewriteLocalInitializerUses(
|
|
25336
25344
|
text,
|
|
25337
|
-
({ node, owned, path: relativePath }) => {
|
|
25345
|
+
({ node, owned: owned2, path: relativePath, reference: reference2 }) => {
|
|
25338
25346
|
if (!this.has(node.name) || runtimeNames.has(node.name)) return null;
|
|
25339
|
-
if (!
|
|
25347
|
+
if (!owned2) {
|
|
25348
|
+
const variable3 = shared.get(terminalName(node.name));
|
|
25349
|
+
if (variable3 !== void 0) return variable3;
|
|
25350
|
+
if (reference2) return null;
|
|
25340
25351
|
const definition2 = this.definitions.get(node.name);
|
|
25341
25352
|
if (this.scalarTypes.has(definition2.type.name)) {
|
|
25342
25353
|
throw new Error(
|
|
@@ -25362,9 +25373,13 @@ var init_local_values = __esm({
|
|
|
25362
25373
|
const annotation2 = terminal2.expression.kind === "annotated" ? terminal2.expression.annotations.find(
|
|
25363
25374
|
(entry) => entry.name === "id"
|
|
25364
25375
|
)?.args[0] : void 0;
|
|
25365
|
-
|
|
25376
|
+
const existingId = storedValueAtPath?.(
|
|
25377
|
+
materializationRoot,
|
|
25378
|
+
placementPath
|
|
25379
|
+
);
|
|
25380
|
+
if (annotation2?.kind === "litString" && existingId !== annotation2.value) {
|
|
25366
25381
|
throw new Error(
|
|
25367
|
-
`Local initializer ${terminal2.global.name} has an @id that does not identify its existing row inside this constructor-backed owner. Remove that @id and
|
|
25382
|
+
`Local initializer ${terminal2.global.name} has an @id that does not identify its existing row inside this constructor-backed owner. Remove that @id and let preparation assign the owning tree, or place the value directly in its own static member.`
|
|
25368
25383
|
);
|
|
25369
25384
|
}
|
|
25370
25385
|
const source = terminal2.global.source;
|
|
@@ -25372,7 +25387,7 @@ var init_local_values = __esm({
|
|
|
25372
25387
|
const id2 = annotation2?.kind === "litString" ? annotation2.value : `__pending__:value:${encodeURIComponent(source.uri)}:${source.range.start.line}:${source.range.start.character}:${encodeURIComponent(terminal2.global.name)}${suffix}`;
|
|
25373
25388
|
for (const { global } of steps) {
|
|
25374
25389
|
const owners = this.owners.get(global.name) ?? /* @__PURE__ */ new Map();
|
|
25375
|
-
owners.set(id2, global.name);
|
|
25390
|
+
owners.set(existingId ?? id2, global.name);
|
|
25376
25391
|
this.owners.set(global.name, owners);
|
|
25377
25392
|
}
|
|
25378
25393
|
identity3?.sites.set(id2, {
|
|
@@ -25391,10 +25406,50 @@ var init_local_values = __esm({
|
|
|
25391
25406
|
});
|
|
25392
25407
|
}
|
|
25393
25408
|
active.delete(node.name);
|
|
25409
|
+
const name = terminalName(node.name);
|
|
25410
|
+
const variable2 = shared.get(name);
|
|
25411
|
+
if (variable2 !== void 0) {
|
|
25412
|
+
bindings.set(variable2, {
|
|
25413
|
+
code: result,
|
|
25414
|
+
type: typeText(this.definitions.get(name).type)
|
|
25415
|
+
});
|
|
25416
|
+
return variable2;
|
|
25417
|
+
}
|
|
25394
25418
|
return result;
|
|
25395
|
-
}
|
|
25419
|
+
},
|
|
25420
|
+
{ includeReferences: true }
|
|
25396
25421
|
);
|
|
25397
|
-
|
|
25422
|
+
const expanded = expand(code, [], runtimeIdentifiers);
|
|
25423
|
+
if (bindings.size === 0) return expanded;
|
|
25424
|
+
const ordered = [];
|
|
25425
|
+
const visited = /* @__PURE__ */ new Set();
|
|
25426
|
+
const visit = (variable2) => {
|
|
25427
|
+
if (visited.has(variable2)) return;
|
|
25428
|
+
visited.add(variable2);
|
|
25429
|
+
for (const use of localInitializerUses(
|
|
25430
|
+
parseCachedInitializer(
|
|
25431
|
+
this.syntax?.expressions,
|
|
25432
|
+
bindings.get(variable2).code
|
|
25433
|
+
),
|
|
25434
|
+
{ includeReferences: true }
|
|
25435
|
+
)) {
|
|
25436
|
+
if (bindings.has(use.node.name)) visit(use.node.name);
|
|
25437
|
+
}
|
|
25438
|
+
ordered.push(variable2);
|
|
25439
|
+
};
|
|
25440
|
+
for (const variable2 of bindings.keys()) visit(variable2);
|
|
25441
|
+
const declarations = ordered.map((variable2) => {
|
|
25442
|
+
const binding = bindings.get(variable2);
|
|
25443
|
+
return `${binding.type} ${variable2} = ${binding.code};`;
|
|
25444
|
+
});
|
|
25445
|
+
const bound = `(() => {
|
|
25446
|
+
${declarations.join("\n")}
|
|
25447
|
+
return ${expanded.code};
|
|
25448
|
+
})()`;
|
|
25449
|
+
return {
|
|
25450
|
+
code: bound,
|
|
25451
|
+
splices: [{ start: 0, end: code.length, text: bound }]
|
|
25452
|
+
};
|
|
25398
25453
|
}
|
|
25399
25454
|
initializer(global) {
|
|
25400
25455
|
const cached = this.initializers.get(global.name);
|
|
@@ -25439,7 +25494,8 @@ var init_local_values = __esm({
|
|
|
25439
25494
|
* lowered, so the answer does not depend on which file lowered first: the
|
|
25440
25495
|
* `@id` its declaration carries (through any alias chain), else the static
|
|
25441
25496
|
* member whose initializer is the local, whose row derives from the member.
|
|
25442
|
-
*
|
|
25497
|
+
* Nested idless locals use a temporary reference resolved after their owners
|
|
25498
|
+
* lower. Constructor-backed owners settle it to the materialized child ID.
|
|
25443
25499
|
*/
|
|
25444
25500
|
declaredTarget(name) {
|
|
25445
25501
|
const definition2 = this.definitions.get(name);
|
|
@@ -25452,7 +25508,11 @@ var init_local_values = __esm({
|
|
|
25452
25508
|
return { id: id2.value, typeName };
|
|
25453
25509
|
}
|
|
25454
25510
|
const owners = this.ownerMembers.get(name);
|
|
25455
|
-
if (owners === void 0)
|
|
25511
|
+
if (owners === void 0) {
|
|
25512
|
+
const locator = `__pending__:local-reference:${encodeURIComponent(name)}`;
|
|
25513
|
+
this.pendingReferences.set(locator, name);
|
|
25514
|
+
return { id: locator, typeName };
|
|
25515
|
+
}
|
|
25456
25516
|
if (owners.length !== 1) {
|
|
25457
25517
|
throw new Error(
|
|
25458
25518
|
`Reference(${name}) requires exactly one owning assignment.`
|
|
@@ -25461,8 +25521,25 @@ var init_local_values = __esm({
|
|
|
25461
25521
|
const owner = owners[0];
|
|
25462
25522
|
return { ownerMemberId: owner.memberId, ownerPath: owner.path, typeName };
|
|
25463
25523
|
}
|
|
25524
|
+
remapTargets(replacements) {
|
|
25525
|
+
for (const owners of this.owners.values()) {
|
|
25526
|
+
for (const [id2, label] of [...owners]) {
|
|
25527
|
+
const target = replacements.get(id2);
|
|
25528
|
+
if (target === void 0) continue;
|
|
25529
|
+
owners.delete(id2);
|
|
25530
|
+
owners.set(target, label);
|
|
25531
|
+
}
|
|
25532
|
+
}
|
|
25533
|
+
}
|
|
25534
|
+
referenceTargets() {
|
|
25535
|
+
return new Map(
|
|
25536
|
+
[...this.pendingReferences].map(([id2, name]) => [id2, this.target(name)])
|
|
25537
|
+
);
|
|
25538
|
+
}
|
|
25464
25539
|
target(name) {
|
|
25465
|
-
|
|
25540
|
+
this.inline(name);
|
|
25541
|
+
const terminal2 = this.terminalInitializers.get(name)?.global.name ?? name;
|
|
25542
|
+
const owners = this.owners.get(terminal2);
|
|
25466
25543
|
if (owners?.size !== 1)
|
|
25467
25544
|
throw new Error(
|
|
25468
25545
|
`Reference(${name}) requires exactly one owning assignment.`
|
|
@@ -34598,7 +34675,7 @@ var init_canonical_json = __esm({
|
|
|
34598
34675
|
});
|
|
34599
34676
|
|
|
34600
34677
|
// ../packages/neoscript-runtime/src/neoscript/initializer-dependencies.ts
|
|
34601
|
-
function materializeInitializerDependencies(pending, materialize) {
|
|
34678
|
+
function materializeInitializerDependencies(pending, materialize, onFailure) {
|
|
34602
34679
|
const active = /* @__PURE__ */ new Set();
|
|
34603
34680
|
for (const rootId of pending) {
|
|
34604
34681
|
const stack = [rootId];
|
|
@@ -34611,19 +34688,27 @@ function materializeInitializerDependencies(pending, materialize) {
|
|
|
34611
34688
|
active.delete(valueId);
|
|
34612
34689
|
stack.pop();
|
|
34613
34690
|
} catch (error) {
|
|
34614
|
-
if (
|
|
34615
|
-
|
|
34616
|
-
|
|
34691
|
+
if (error instanceof PendingInitializerDependency && pending.has(error.valueId)) {
|
|
34692
|
+
if (!active.has(error.valueId)) {
|
|
34693
|
+
active.add(error.valueId);
|
|
34694
|
+
stack.push(error.valueId);
|
|
34695
|
+
continue;
|
|
34696
|
+
}
|
|
34617
34697
|
const cycle = new NSGetterRuntimeError(
|
|
34618
34698
|
`Initializer dependency cycle: ${[...stack, error.valueId].join(" -> ")}. Remove a dependency so these values can be initialized in order.`
|
|
34619
34699
|
);
|
|
34620
34700
|
cycle.initializerValueId = valueId;
|
|
34621
34701
|
cycle.node = error.node;
|
|
34622
34702
|
cycle.source = error.source;
|
|
34623
|
-
|
|
34703
|
+
error = cycle;
|
|
34704
|
+
}
|
|
34705
|
+
if (onFailure === void 0) throw error;
|
|
34706
|
+
onFailure(stack, error);
|
|
34707
|
+
for (const id2 of stack) {
|
|
34708
|
+
pending.delete(id2);
|
|
34709
|
+
active.delete(id2);
|
|
34624
34710
|
}
|
|
34625
|
-
|
|
34626
|
-
stack.push(error.valueId);
|
|
34711
|
+
stack.length = 0;
|
|
34627
34712
|
}
|
|
34628
34713
|
}
|
|
34629
34714
|
}
|
|
@@ -39361,6 +39446,7 @@ function indexRuntimeCollectionChange(collection, entry, ctx, removedEntries = n
|
|
|
39361
39446
|
indexes4.memberByRowId.clear();
|
|
39362
39447
|
}
|
|
39363
39448
|
if (Array.isArray(collection)) forgetLocalListIndexes(ctx, collection);
|
|
39449
|
+
else indexes4.declaredListByArray = /* @__PURE__ */ new WeakMap();
|
|
39364
39450
|
markOverlayMutated(ctx, collection);
|
|
39365
39451
|
if (ctx.__valueOverlay instanceof LazyValueOverlay)
|
|
39366
39452
|
indexes4.overlayRevision = ctx.__valueOverlay.revision;
|
|
@@ -42945,6 +43031,7 @@ function replaceRowValue(row, value, receiver, ctx) {
|
|
|
42945
43031
|
unindexEvaluatorRow(indexes4, row, true);
|
|
42946
43032
|
row.value = value;
|
|
42947
43033
|
indexEvaluatorRow(indexes4, row, true);
|
|
43034
|
+
indexes4.declaredListByArray = /* @__PURE__ */ new WeakMap();
|
|
42948
43035
|
markOverlayMutated(ctx, receiver);
|
|
42949
43036
|
if (ctx.__valueOverlay instanceof LazyValueOverlay)
|
|
42950
43037
|
indexes4.overlayRevision = ctx.__valueOverlay.revision;
|
|
@@ -47183,6 +47270,17 @@ function runtimeTypeCheck(value, checkType, ctx, seenCollections = /* @__PURE__
|
|
|
47183
47270
|
case 8 /* Enum */:
|
|
47184
47271
|
return Array.isArray(value) && value.every((v) => typeof v === "string");
|
|
47185
47272
|
case 7 /* Class */: {
|
|
47273
|
+
if (isVariantClassId(checkType.classId)) {
|
|
47274
|
+
if (!isVariantRefValue(value)) return false;
|
|
47275
|
+
const targetParameter = evaluatorSchemaIndex(ctx).classesById.get(
|
|
47276
|
+
checkType.classId
|
|
47277
|
+
)?.genericParams?.[0];
|
|
47278
|
+
const target = targetParameter === void 0 ? void 0 : receiverClosedTypeArguments(checkType.typeArguments, ctx)?.[targetParameter.id];
|
|
47279
|
+
return target?.type !== 7 /* Class */ || evaluatorSchemaIndex(ctx).classIsOrExtends(
|
|
47280
|
+
value.classId,
|
|
47281
|
+
target.classId
|
|
47282
|
+
);
|
|
47283
|
+
}
|
|
47186
47284
|
if (typeof value !== "object") return false;
|
|
47187
47285
|
const row = trackedRowForValueReference(value, ctx);
|
|
47188
47286
|
const runtimeClassId = row === null ? void 0 : classIdForValueRow(row, ctx);
|
|
@@ -52225,6 +52323,21 @@ function encodeRequiredConstructorArgument(args) {
|
|
|
52225
52323
|
`Constructor argument '${args.parameterId}' has an unresolved generic type.`
|
|
52226
52324
|
);
|
|
52227
52325
|
}
|
|
52326
|
+
if (args.typeInfo.type === 7 /* Class */ && isVariantClassId(args.typeInfo.classId)) {
|
|
52327
|
+
if (args.value === null || args.value === void 0) return null;
|
|
52328
|
+
const selection2 = readVariantSelection(
|
|
52329
|
+
args.value,
|
|
52330
|
+
`Constructor argument '${args.parameterId}'`
|
|
52331
|
+
);
|
|
52332
|
+
if (selection2.rowValueId !== null) {
|
|
52333
|
+
adoptTracked(selection2.rowValueId, "variant-row");
|
|
52334
|
+
}
|
|
52335
|
+
return {
|
|
52336
|
+
classId: selection2.classId,
|
|
52337
|
+
variantId: selection2.variantId,
|
|
52338
|
+
...selection2.rowValueId === null ? {} : { rowValueId: selection2.rowValueId }
|
|
52339
|
+
};
|
|
52340
|
+
}
|
|
52228
52341
|
if (args.typeInfo.type === 7 /* Class */ || args.typeInfo.type === 22 /* Interface */) {
|
|
52229
52342
|
if (args.value === null || args.value === void 0) return null;
|
|
52230
52343
|
const aggregateId2 = trackedId ?? replayedAggregateId;
|
|
@@ -52360,6 +52473,16 @@ function readVariantSelection(value, label) {
|
|
|
52360
52473
|
}
|
|
52361
52474
|
return { classId, variantId, rowValueId: rowValueId ?? null };
|
|
52362
52475
|
}
|
|
52476
|
+
function variantConstructorRecord(row, schemaKeys) {
|
|
52477
|
+
const recipe = isLiteralValueContent(row) ? row.constructorArgs : void 0;
|
|
52478
|
+
const result = {};
|
|
52479
|
+
if (recipe == null) return result;
|
|
52480
|
+
for (let index = 0; index < schemaKeys.length; index++) {
|
|
52481
|
+
const argument2 = recipe[`__arg_${index}__`];
|
|
52482
|
+
if (argument2 !== void 0) result[schemaKeys[index]] = argument2;
|
|
52483
|
+
}
|
|
52484
|
+
return result;
|
|
52485
|
+
}
|
|
52363
52486
|
function resolveVariantGraph(selection2, ctx) {
|
|
52364
52487
|
const variantId = selection2.variantId;
|
|
52365
52488
|
if (variantId === null) {
|
|
@@ -52397,20 +52520,14 @@ function resolveVariantGraph(selection2, ctx) {
|
|
|
52397
52520
|
);
|
|
52398
52521
|
}
|
|
52399
52522
|
const effectiveRoot = { ...root };
|
|
52400
|
-
const recipe = row
|
|
52401
|
-
|
|
52402
|
-
|
|
52403
|
-
|
|
52404
|
-
|
|
52405
|
-
|
|
52406
|
-
|
|
52407
|
-
];
|
|
52408
|
-
for (const [schemaKey, argumentIndex] of settledVariantSlots) {
|
|
52409
|
-
if (effectiveRoot[schemaKey] !== void 0) continue;
|
|
52410
|
-
const argument2 = recipe[`__arg_${argumentIndex}__`];
|
|
52411
|
-
if (argument2 === void 0 || argument2 === null) continue;
|
|
52412
|
-
effectiveRoot[schemaKey] = argument2;
|
|
52413
|
-
}
|
|
52523
|
+
const recipe = variantConstructorRecord(row, [
|
|
52524
|
+
"Initialize",
|
|
52525
|
+
"Apply",
|
|
52526
|
+
"Overrides",
|
|
52527
|
+
"ChildOverrides"
|
|
52528
|
+
]);
|
|
52529
|
+
for (const [key, value] of Object.entries(recipe)) {
|
|
52530
|
+
if (effectiveRoot[key] === void 0) effectiveRoot[key] = value;
|
|
52414
52531
|
}
|
|
52415
52532
|
return {
|
|
52416
52533
|
variantId,
|
|
@@ -52505,7 +52622,7 @@ function invokeVariantClosure(args) {
|
|
|
52505
52622
|
[DELEGATE_LEXICAL_THIS]: lexicalThis,
|
|
52506
52623
|
[DELEGATE_LEXICAL_ROOT]: ctx.rootValue
|
|
52507
52624
|
};
|
|
52508
|
-
return invokeDelegateValue(bound, parameters, ctx);
|
|
52625
|
+
return invokeDelegateValue(bound, parameters, ctx, void 0, lexicalThis);
|
|
52509
52626
|
}
|
|
52510
52627
|
function writeVariantOverrideSlot(target, schemaKey, value, ctx, answeredValueIds) {
|
|
52511
52628
|
assertStoredReplayMutableValue(target, ctx, "variant override", schemaKey);
|
|
@@ -52701,6 +52818,32 @@ function replacesInterfaceSlotRow(member, target, overrideRow, ctx) {
|
|
|
52701
52818
|
if (targetRow === null) return false;
|
|
52702
52819
|
return classIdForValueRow(targetRow, ctx) !== overrideRow.classId;
|
|
52703
52820
|
}
|
|
52821
|
+
function readVariantChildOverrideSlot(entryRow, schemaKey, ctx) {
|
|
52822
|
+
const entry = readRowValue(entryRow, ctx);
|
|
52823
|
+
if (typeof entry !== "object" || entry === null || Array.isArray(entry))
|
|
52824
|
+
return null;
|
|
52825
|
+
const classId = classIdForValueRow(entryRow, ctx);
|
|
52826
|
+
const memberId = classId == null ? null : cachedMergedSchemaMemberId(classId, schemaKey, ctx);
|
|
52827
|
+
const member = memberId === null ? null : evalMemberById(ctx.vm, memberId);
|
|
52828
|
+
if (member === null) {
|
|
52829
|
+
throw new NSGetterRuntimeError(
|
|
52830
|
+
`Child override '${entryRow.id}' has no '${schemaKey}' member.`
|
|
52831
|
+
);
|
|
52832
|
+
}
|
|
52833
|
+
const slot = readClassMember({
|
|
52834
|
+
member,
|
|
52835
|
+
schemaKey,
|
|
52836
|
+
record: entry,
|
|
52837
|
+
expandedRecord: () => variantConstructorRecord(entryRow, ["Selector", "Overrides"]),
|
|
52838
|
+
mode: "runtime"
|
|
52839
|
+
});
|
|
52840
|
+
if (slot.kind === "value") return slot.value;
|
|
52841
|
+
if (slot.kind === "declaration") {
|
|
52842
|
+
const result = readDeclarationDefault(member, ctx);
|
|
52843
|
+
return result.matched ? result.value : null;
|
|
52844
|
+
}
|
|
52845
|
+
return null;
|
|
52846
|
+
}
|
|
52704
52847
|
function applyVariantDeclarativeHalves(instance, graph, ctx, answeredValueIds) {
|
|
52705
52848
|
applyVariantPartial(
|
|
52706
52849
|
instance,
|
|
@@ -52739,14 +52882,13 @@ function applyVariantDeclarativeHalves(instance, graph, ctx, answeredValueIds) {
|
|
|
52739
52882
|
`Variant '${graph.name}' references missing child-override row '${entryId}'.`
|
|
52740
52883
|
);
|
|
52741
52884
|
}
|
|
52742
|
-
const entry = entryRow
|
|
52885
|
+
const entry = readRowValue(entryRow, ctx);
|
|
52743
52886
|
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
|
|
52744
52887
|
continue;
|
|
52745
52888
|
}
|
|
52746
|
-
const entryRecord = entry;
|
|
52747
52889
|
const label = `Variant '${graph.name}' child override '${entryId}'`;
|
|
52748
52890
|
const child2 = invokeVariantClosure({
|
|
52749
|
-
closureValueId:
|
|
52891
|
+
closureValueId: readVariantChildOverrideSlot(entryRow, "Selector", ctx),
|
|
52750
52892
|
ctx,
|
|
52751
52893
|
label: `${label} Selector`,
|
|
52752
52894
|
lexicalThis: instance,
|
|
@@ -52759,7 +52901,7 @@ function applyVariantDeclarativeHalves(instance, graph, ctx, answeredValueIds) {
|
|
|
52759
52901
|
}
|
|
52760
52902
|
applyVariantPartial(
|
|
52761
52903
|
child2,
|
|
52762
|
-
|
|
52904
|
+
readVariantChildOverrideSlot(entryRow, "Overrides", ctx),
|
|
52763
52905
|
ctx,
|
|
52764
52906
|
label,
|
|
52765
52907
|
answeredValueIds
|
|
@@ -52881,7 +53023,7 @@ function collectVariantDeclarativeAnsweredSlots(instance, graph, ctx) {
|
|
|
52881
53023
|
}
|
|
52882
53024
|
const label = `Variant '${graph.name}' child override '${entryId}'`;
|
|
52883
53025
|
const child2 = invokeVariantClosure({
|
|
52884
|
-
closureValueId:
|
|
53026
|
+
closureValueId: readVariantChildOverrideSlot(entryRow, "Selector", ctx),
|
|
52885
53027
|
ctx,
|
|
52886
53028
|
label: `${label} Selector`,
|
|
52887
53029
|
lexicalThis: instance,
|
|
@@ -52894,7 +53036,7 @@ function collectVariantDeclarativeAnsweredSlots(instance, graph, ctx) {
|
|
|
52894
53036
|
}
|
|
52895
53037
|
collectVariantPartialAnsweredSlots(
|
|
52896
53038
|
child2,
|
|
52897
|
-
|
|
53039
|
+
readVariantChildOverrideSlot(entryRow, "Overrides", ctx),
|
|
52898
53040
|
ctx,
|
|
52899
53041
|
label,
|
|
52900
53042
|
slots
|
|
@@ -57001,22 +57143,29 @@ var init_lookup_declared_type = __esm({
|
|
|
57001
57143
|
});
|
|
57002
57144
|
|
|
57003
57145
|
// ../packages/neoscript-runtime/src/values/member-declared-type-info.ts
|
|
57004
|
-
function resolveMemberDeclaredTypeInfo(member, members2, ownerClass = null, env) {
|
|
57146
|
+
function resolveMemberDeclaredTypeInfo(member, members2, classes, ownerClass = null, env) {
|
|
57005
57147
|
return resolveMemberDeclaredTypeInfoInternal(
|
|
57006
57148
|
member,
|
|
57007
57149
|
members2,
|
|
57150
|
+
classes,
|
|
57008
57151
|
/* @__PURE__ */ new Set(),
|
|
57009
57152
|
ownerClass,
|
|
57010
57153
|
env,
|
|
57011
57154
|
ownerClass === null ? void 0 : classConstrainedGenerics([ownerClass])
|
|
57012
57155
|
);
|
|
57013
57156
|
}
|
|
57014
|
-
function resolveMemberDeclaredTypeInfoInternal(member, members2, seen, ownerClass, env, isClassConstrained) {
|
|
57157
|
+
function resolveMemberDeclaredTypeInfoInternal(member, members2, classes, seen, ownerClass, env, isClassConstrained) {
|
|
57015
57158
|
const resolved = env === void 0 ? resolveMember(member, members2) : substituteMember(member, env, members2);
|
|
57016
57159
|
const memberId = getField(resolved, "id");
|
|
57017
57160
|
if (typeof memberId === "string" && seen.has(memberId)) return null;
|
|
57018
57161
|
const nextSeen = typeof memberId === "string" ? /* @__PURE__ */ new Set([...seen, memberId]) : new Set(seen);
|
|
57019
57162
|
if (isMemberNSPropertyBase(resolved)) return resolved.returnTypeInfo;
|
|
57163
|
+
if (isMemberVariantBase(resolved)) {
|
|
57164
|
+
return variantMemberDeclaredTypeInfo(
|
|
57165
|
+
resolved,
|
|
57166
|
+
neoVariantSystemClass(classes, resolved.valueTypeInfo != null)
|
|
57167
|
+
);
|
|
57168
|
+
}
|
|
57020
57169
|
if (isClassSlotMember(resolved)) {
|
|
57021
57170
|
const typeArguments = Object.fromEntries(
|
|
57022
57171
|
Object.entries(declaredSlotArguments(resolved) ?? {}).flatMap(
|
|
@@ -57036,6 +57185,7 @@ function resolveMemberDeclaredTypeInfoInternal(member, members2, seen, ownerClas
|
|
|
57036
57185
|
const argumentType2 = resolveMemberDeclaredTypeInfoInternal(
|
|
57037
57186
|
argumentMember,
|
|
57038
57187
|
members2,
|
|
57188
|
+
classes,
|
|
57039
57189
|
nextSeen,
|
|
57040
57190
|
ownerClass,
|
|
57041
57191
|
env,
|
|
@@ -57106,6 +57256,7 @@ function resolveMemberDeclaredTypeInfoInternal(member, members2, seen, ownerClas
|
|
|
57106
57256
|
const typeInfo = resolveMemberDeclaredTypeInfoInternal(
|
|
57107
57257
|
descriptor,
|
|
57108
57258
|
members2,
|
|
57259
|
+
classes,
|
|
57109
57260
|
nextSeen,
|
|
57110
57261
|
ownerClass,
|
|
57111
57262
|
env,
|
|
@@ -57134,6 +57285,7 @@ function resolveMemberDeclaredTypeInfoInternal(member, members2, seen, ownerClas
|
|
|
57134
57285
|
const entryTypeInfo = resolveMemberDeclaredTypeInfoInternal(
|
|
57135
57286
|
entry,
|
|
57136
57287
|
members2,
|
|
57288
|
+
classes,
|
|
57137
57289
|
nextSeen,
|
|
57138
57290
|
ownerClass,
|
|
57139
57291
|
env,
|
|
@@ -57158,6 +57310,7 @@ function resolveMemberDeclaredTypeInfoInternal(member, members2, seen, ownerClas
|
|
|
57158
57310
|
return resolveMemberDeclaredTypeInfoInternal(
|
|
57159
57311
|
collection,
|
|
57160
57312
|
members2,
|
|
57313
|
+
classes,
|
|
57161
57314
|
nextSeen,
|
|
57162
57315
|
ownerClass,
|
|
57163
57316
|
env,
|
|
@@ -57206,6 +57359,7 @@ var init_member_declared_type_info = __esm({
|
|
|
57206
57359
|
init_inheritance();
|
|
57207
57360
|
init_parameter_defaults();
|
|
57208
57361
|
init_core();
|
|
57362
|
+
init_variant_member();
|
|
57209
57363
|
}
|
|
57210
57364
|
});
|
|
57211
57365
|
|
|
@@ -57214,6 +57368,15 @@ function recordEntries(value) {
|
|
|
57214
57368
|
if (typeof value !== "object" || value === null) return [];
|
|
57215
57369
|
return Object.values(value);
|
|
57216
57370
|
}
|
|
57371
|
+
function isVariantArgument(value, typeInfo) {
|
|
57372
|
+
return typeInfo?.type === 7 /* Class */ && isVariantClassId(typeInfo.classId) && isVariantRefValue(value);
|
|
57373
|
+
}
|
|
57374
|
+
function remapVariantArgument(value, typeInfo, remap) {
|
|
57375
|
+
if (!isVariantArgument(value, typeInfo)) return value;
|
|
57376
|
+
if (typeof value.rowValueId !== "string") return value;
|
|
57377
|
+
const rowValueId = remap(value.rowValueId);
|
|
57378
|
+
return rowValueId === value.rowValueId ? value : { ...value, rowValueId };
|
|
57379
|
+
}
|
|
57217
57380
|
function resolveSemanticOwnerMembersForValues(document, targetValueIds, additionalRoots, rootOwners, rootKinds, graphOf = () => new MaterializedValueGraphContext(
|
|
57218
57381
|
document,
|
|
57219
57382
|
void 0,
|
|
@@ -57525,7 +57688,11 @@ function tryResolveTypeInfo(document, rawTypeInfo, env) {
|
|
|
57525
57688
|
function tryMemberTypeInfo(document, rawMember, env) {
|
|
57526
57689
|
try {
|
|
57527
57690
|
const member = substituteMember(rawMember, env, document.members);
|
|
57528
|
-
const typeInfo = resolveMemberDeclaredTypeInfo(
|
|
57691
|
+
const typeInfo = resolveMemberDeclaredTypeInfo(
|
|
57692
|
+
member,
|
|
57693
|
+
document.members,
|
|
57694
|
+
document.classes
|
|
57695
|
+
);
|
|
57529
57696
|
if (typeInfo === null) return null;
|
|
57530
57697
|
return tryResolveTypeInfo(document, typeInfo, env);
|
|
57531
57698
|
} catch {
|
|
@@ -57565,6 +57732,7 @@ var init_constructor_argument_ownership = __esm({
|
|
|
57565
57732
|
init_core();
|
|
57566
57733
|
init_interface_implementers();
|
|
57567
57734
|
init_members();
|
|
57735
|
+
init_reference_category();
|
|
57568
57736
|
init_neoscript();
|
|
57569
57737
|
init_project_schema_index();
|
|
57570
57738
|
init_member_declared_type_info();
|
|
@@ -57805,7 +57973,7 @@ var init_constructor_argument_ownership = __esm({
|
|
|
57805
57973
|
const typeInfo = parameterTypes.get(parameterId);
|
|
57806
57974
|
return [
|
|
57807
57975
|
parameterId,
|
|
57808
|
-
typeInfo !== void 0 && (isAggregateTypeInfo(typeInfo) || typeInfo.type === 29 /* Reference */) && typeof argument2 === "string" ? rewriteId(argument2) : argument2
|
|
57976
|
+
typeInfo !== void 0 && (isAggregateTypeInfo(typeInfo) || typeInfo.type === 29 /* Reference */) && typeof argument2 === "string" ? rewriteId(argument2) : remapVariantArgument(argument2, typeInfo, rewriteId)
|
|
57809
57977
|
];
|
|
57810
57978
|
}
|
|
57811
57979
|
)
|
|
@@ -57841,15 +58009,18 @@ var init_constructor_argument_ownership = __esm({
|
|
|
57841
58009
|
ids.push(edge.targetValueId);
|
|
57842
58010
|
return ids;
|
|
57843
58011
|
}
|
|
57844
|
-
/**
|
|
58012
|
+
/** Reference targets and bound lookup rows retained by creation data. */
|
|
57845
58013
|
referenceArgumentIds(row) {
|
|
57846
58014
|
if (!isLiteralValueContent(row)) return [];
|
|
57847
58015
|
const args = row.constructorArgs;
|
|
57848
58016
|
if (args === void 0 || args === null) return [];
|
|
57849
58017
|
const ids = [];
|
|
57850
|
-
for (const parameterId of this.
|
|
58018
|
+
for (const [parameterId, typeInfo] of this.constructorParameterTypes(row)) {
|
|
57851
58019
|
const argument2 = args[parameterId];
|
|
57852
|
-
if (typeof argument2 === "string")
|
|
58020
|
+
if (typeInfo.type === 29 /* Reference */ && typeof argument2 === "string")
|
|
58021
|
+
ids.push(argument2);
|
|
58022
|
+
else if (isVariantArgument(argument2, typeInfo) && typeof argument2.rowValueId === "string")
|
|
58023
|
+
ids.push(argument2.rowValueId);
|
|
57853
58024
|
}
|
|
57854
58025
|
return ids;
|
|
57855
58026
|
}
|
|
@@ -57858,23 +58029,23 @@ var init_constructor_argument_ownership = __esm({
|
|
|
57858
58029
|
const args = row.constructorArgs;
|
|
57859
58030
|
if (args === void 0 || args === null) return args;
|
|
57860
58031
|
let remapped;
|
|
57861
|
-
for (const parameterId of this.
|
|
58032
|
+
for (const [parameterId, typeInfo] of this.constructorParameterTypes(
|
|
57862
58033
|
row,
|
|
57863
58034
|
contextualMember
|
|
57864
58035
|
)) {
|
|
57865
58036
|
const argument2 = args[parameterId];
|
|
57866
|
-
|
|
57867
|
-
const target = remap(argument2);
|
|
58037
|
+
const target = typeInfo.type === 29 /* Reference */ && typeof argument2 === "string" ? remap(argument2) : remapVariantArgument(argument2, typeInfo, remap);
|
|
57868
58038
|
if (target !== argument2) (remapped ??= { ...args })[parameterId] = target;
|
|
57869
58039
|
}
|
|
57870
58040
|
return remapped ?? args;
|
|
57871
58041
|
}
|
|
57872
|
-
*
|
|
57873
|
-
|
|
57874
|
-
|
|
57875
|
-
|
|
57876
|
-
|
|
57877
|
-
if (typeInfo
|
|
58042
|
+
*variantArgumentSelections(row) {
|
|
58043
|
+
if (!isLiteralValueContent(row)) return;
|
|
58044
|
+
if (row.constructorArgs == null) return;
|
|
58045
|
+
for (const [parameterId, typeInfo] of this.constructorParameterTypes(row)) {
|
|
58046
|
+
const argument2 = row.constructorArgs[parameterId];
|
|
58047
|
+
if (isVariantArgument(argument2, typeInfo)) yield argument2;
|
|
58048
|
+
}
|
|
57878
58049
|
}
|
|
57879
58050
|
slotEntries(row) {
|
|
57880
58051
|
const value = row.value;
|
|
@@ -57975,6 +58146,17 @@ var init_constructor_argument_ownership = __esm({
|
|
|
57975
58146
|
if (member === void 0) return null;
|
|
57976
58147
|
return this.memberTypeInfo(member, env);
|
|
57977
58148
|
}
|
|
58149
|
+
if ((rawTypeInfo.type === 7 /* Class */ || rawTypeInfo.type === 22 /* Interface */) && rawTypeInfo.typeArguments !== void 0) {
|
|
58150
|
+
const typeArguments = {};
|
|
58151
|
+
for (const [parameterId, argument2] of Object.entries(
|
|
58152
|
+
rawTypeInfo.typeArguments
|
|
58153
|
+
)) {
|
|
58154
|
+
const resolved = this.resolveTypeInfo(argument2, env);
|
|
58155
|
+
if (resolved === null) return null;
|
|
58156
|
+
typeArguments[parameterId] = resolved;
|
|
58157
|
+
}
|
|
58158
|
+
return { ...rawTypeInfo, typeArguments };
|
|
58159
|
+
}
|
|
57978
58160
|
if (rawTypeInfo.type === 30 /* Tuple */) {
|
|
57979
58161
|
const elements = [];
|
|
57980
58162
|
for (const element of rawTypeInfo.elements) {
|
|
@@ -58006,7 +58188,8 @@ var init_constructor_argument_ownership = __esm({
|
|
|
58006
58188
|
const member = substituteMember(rawMember, env, this.document.members);
|
|
58007
58189
|
const typeInfo = resolveMemberDeclaredTypeInfo(
|
|
58008
58190
|
member,
|
|
58009
|
-
this.document.members
|
|
58191
|
+
this.document.members,
|
|
58192
|
+
this.document.classes
|
|
58010
58193
|
);
|
|
58011
58194
|
return typeInfo === null ? null : this.resolveTypeInfo(typeInfo, env);
|
|
58012
58195
|
} catch {
|
|
@@ -63101,7 +63284,7 @@ function indexedInitializerEvaluatorLookups(document, key, revision) {
|
|
|
63101
63284
|
});
|
|
63102
63285
|
return lookups;
|
|
63103
63286
|
}
|
|
63104
|
-
function createInitializerMaterializationBatch(authoredDocument, pendingInitializerIds) {
|
|
63287
|
+
function createInitializerMaterializationBatch(authoredDocument, pendingInitializerIds, referenceOwners) {
|
|
63105
63288
|
const indexed = createInitializerBatchLookups(authoredDocument);
|
|
63106
63289
|
let hasListenerMetadata;
|
|
63107
63290
|
const unorderedListEntryIds2 = indexed.snapshot().unorderedListEntryIds;
|
|
@@ -63251,7 +63434,12 @@ function createInitializerMaterializationBatch(authoredDocument, pendingInitiali
|
|
|
63251
63434
|
base.valueById(id2),
|
|
63252
63435
|
(id3) => virtual().declarationDefaultGraph(id3, member)
|
|
63253
63436
|
),
|
|
63254
|
-
valueById: (id2) =>
|
|
63437
|
+
valueById: (id2) => {
|
|
63438
|
+
const owner = referenceOwners?.get(id2);
|
|
63439
|
+
if (owner !== void 0 && pendingInitializerIds?.has(owner))
|
|
63440
|
+
throw new PendingInitializerDependency(owner);
|
|
63441
|
+
return base.valueById(id2) ?? expandedById.get(id2) ?? virtual().valueById(id2);
|
|
63442
|
+
},
|
|
63255
63443
|
rowForValueReference: (value) => base.rowForValueReference(value) ?? expandedByReference.get(value) ?? virtual().rowForValueReference(value),
|
|
63256
63444
|
virtualInstanceRowsForValue: (id2) => {
|
|
63257
63445
|
const cached = cachedById.get(id2);
|
|
@@ -63631,13 +63819,37 @@ function derivedGenericArgumentMemberId(parentRecordId, genericParamId) {
|
|
|
63631
63819
|
)
|
|
63632
63820
|
);
|
|
63633
63821
|
}
|
|
63634
|
-
|
|
63822
|
+
function pendingGenericArgumentMemberId(parentRecordId, genericParamId) {
|
|
63823
|
+
return `${PENDING_GENERIC_ARGUMENT_PREFIX}${encodeURIComponent(parentRecordId)}:${encodeURIComponent(genericParamId)}`;
|
|
63824
|
+
}
|
|
63825
|
+
function pendingGenericArgumentIdentity(token) {
|
|
63826
|
+
if (!token.startsWith(PENDING_GENERIC_ARGUMENT_PREFIX)) return null;
|
|
63827
|
+
const parts = token.slice(PENDING_GENERIC_ARGUMENT_PREFIX.length).split(":");
|
|
63828
|
+
if (parts.length !== 2)
|
|
63829
|
+
throw new Error(
|
|
63830
|
+
`Pending generic argument identity must have two components: ${token}.`
|
|
63831
|
+
);
|
|
63832
|
+
if (!parts[0])
|
|
63833
|
+
throw new Error(
|
|
63834
|
+
`Pending generic argument identity has no parent: ${token}.`
|
|
63835
|
+
);
|
|
63836
|
+
if (!parts[1])
|
|
63837
|
+
throw new Error(
|
|
63838
|
+
`Pending generic argument identity has no parameter: ${token}.`
|
|
63839
|
+
);
|
|
63840
|
+
return {
|
|
63841
|
+
parentRecordId: decodeURIComponent(parts[0]),
|
|
63842
|
+
genericParamId: decodeURIComponent(parts[1])
|
|
63843
|
+
};
|
|
63844
|
+
}
|
|
63845
|
+
var NEO_GENERIC_ARGUMENT_MEMBER_NAMESPACE, PENDING_GENERIC_ARGUMENT_PREFIX;
|
|
63635
63846
|
var init_generic_argument_member_id = __esm({
|
|
63636
63847
|
"../src/models/members/generic-argument-member-id.ts"() {
|
|
63637
63848
|
"use strict";
|
|
63638
63849
|
init_dist_node();
|
|
63639
63850
|
init_system_record_id();
|
|
63640
63851
|
NEO_GENERIC_ARGUMENT_MEMBER_NAMESPACE = "6a4e1d38-9b52-5c0f-8d71-3e2a7f4b6c19";
|
|
63852
|
+
PENDING_GENERIC_ARGUMENT_PREFIX = "__pending__:generic-argument-member:";
|
|
63641
63853
|
}
|
|
63642
63854
|
});
|
|
63643
63855
|
|
|
@@ -74918,11 +75130,97 @@ var init_strict_resolver = __esm({
|
|
|
74918
75130
|
if (callee.kind !== "member") return null;
|
|
74919
75131
|
const isInitialize = callee.name === VARIANT_INITIALIZE_NAME;
|
|
74920
75132
|
const isApply = callee.name === VARIANT_APPLY_NAME;
|
|
74921
|
-
|
|
75133
|
+
const isBind = callee.name === "Bind";
|
|
75134
|
+
if (!isInitialize && !isApply && !isBind) return null;
|
|
74922
75135
|
if (callee.receiver.kind === "ident" && !this.hasValueReceiver(callee.receiver.name, scope) && this.project.typeByName.has(callee.receiver.name)) {
|
|
74923
75136
|
return null;
|
|
74924
75137
|
}
|
|
74925
75138
|
const receiver = receiverValue ? receiverValue() : this.resolveExpression(callee.receiver, scope);
|
|
75139
|
+
if (isBind) {
|
|
75140
|
+
const variantInfo2 = this.variantTypeInfo(receiver.type);
|
|
75141
|
+
if (variantInfo2 === null) return null;
|
|
75142
|
+
if (variantInfo2.valueType === null) {
|
|
75143
|
+
throw new CompileError("Only a lookup variant can bind a row.", pos);
|
|
75144
|
+
}
|
|
75145
|
+
if (callee.optional === true) {
|
|
75146
|
+
throw new CompileError("Bind requires a non-null lookup variant.", pos);
|
|
75147
|
+
}
|
|
75148
|
+
if (receiver.pointer.type !== "variant" /* Variant */) {
|
|
75149
|
+
throw new CompileError(
|
|
75150
|
+
"Bind requires a declared lookup variant path.",
|
|
75151
|
+
pos
|
|
75152
|
+
);
|
|
75153
|
+
}
|
|
75154
|
+
requireArgCount("NeoLookupVariant.Bind", argumentsList2, 1, pos);
|
|
75155
|
+
const row2 = argumentsList2[0];
|
|
75156
|
+
if (row2.kind !== "call") {
|
|
75157
|
+
throw new CompileError(
|
|
75158
|
+
'Bind requires Reference(id: "value-id").',
|
|
75159
|
+
row2.pos
|
|
75160
|
+
);
|
|
75161
|
+
}
|
|
75162
|
+
if (row2.callee.kind !== "ident" || row2.callee.name !== "Reference") {
|
|
75163
|
+
throw new CompileError(
|
|
75164
|
+
"Bind requires a Reference row argument.",
|
|
75165
|
+
row2.pos
|
|
75166
|
+
);
|
|
75167
|
+
}
|
|
75168
|
+
requireArgCount("Bind Reference", row2.args, 1, row2.pos);
|
|
75169
|
+
if (row2.argumentNames?.[0] !== "id") {
|
|
75170
|
+
throw new CompileError(
|
|
75171
|
+
'Bind requires Reference(id: "value-id").',
|
|
75172
|
+
row2.pos
|
|
75173
|
+
);
|
|
75174
|
+
}
|
|
75175
|
+
const id2 = row2.args[0];
|
|
75176
|
+
if (id2.kind !== "litString") {
|
|
75177
|
+
throw new CompileError(
|
|
75178
|
+
"Bound row id must be a string literal.",
|
|
75179
|
+
id2.pos
|
|
75180
|
+
);
|
|
75181
|
+
}
|
|
75182
|
+
if (id2.value.length === 0) {
|
|
75183
|
+
throw new CompileError("Bound row id must not be empty.", id2.pos);
|
|
75184
|
+
}
|
|
75185
|
+
if (row2.typeArguments !== void 0) {
|
|
75186
|
+
if (row2.typeArguments.length !== 1) {
|
|
75187
|
+
throw new CompileError(
|
|
75188
|
+
"Reference requires exactly one generic target type.",
|
|
75189
|
+
row2.pos
|
|
75190
|
+
);
|
|
75191
|
+
}
|
|
75192
|
+
this.requireAssignable(
|
|
75193
|
+
this.resolveType(row2.typeArguments[0]),
|
|
75194
|
+
variantInfo2.valueType,
|
|
75195
|
+
row2.pos,
|
|
75196
|
+
"Lookup variant row"
|
|
75197
|
+
);
|
|
75198
|
+
}
|
|
75199
|
+
const rowType = this.context.persistedReferenceTypes?.get(id2.value);
|
|
75200
|
+
if (rowType !== void 0) {
|
|
75201
|
+
this.requireAssignable(
|
|
75202
|
+
neoScriptReadType(rowType),
|
|
75203
|
+
variantInfo2.valueType,
|
|
75204
|
+
row2.pos,
|
|
75205
|
+
"Lookup variant row"
|
|
75206
|
+
);
|
|
75207
|
+
}
|
|
75208
|
+
const bound = this.project.typeByName.get(NEO_VARIANT_TYPE_NAME);
|
|
75209
|
+
if (bound === void 0) {
|
|
75210
|
+
throw new CompileError(
|
|
75211
|
+
`The seeded '${NEO_VARIANT_TYPE_NAME}' class is missing.`,
|
|
75212
|
+
pos
|
|
75213
|
+
);
|
|
75214
|
+
}
|
|
75215
|
+
return {
|
|
75216
|
+
pointer: { ...receiver.pointer, rowValueId: id2.value },
|
|
75217
|
+
type: {
|
|
75218
|
+
kind: "named",
|
|
75219
|
+
typeId: bound.id,
|
|
75220
|
+
typeArguments: receiver.type.kind === "named" ? receiver.type.typeArguments?.slice(0, 1) ?? [] : []
|
|
75221
|
+
}
|
|
75222
|
+
};
|
|
75223
|
+
}
|
|
74926
75224
|
if (isInitialize) {
|
|
74927
75225
|
const variantInfo2 = this.variantTypeInfo(receiver.type);
|
|
74928
75226
|
if (variantInfo2 === null) return null;
|
|
@@ -76824,6 +77122,33 @@ var init_strict_resolver = __esm({
|
|
|
76824
77122
|
typeArguments
|
|
76825
77123
|
);
|
|
76826
77124
|
}
|
|
77125
|
+
if (callee.kind === "lambda" && expected !== void 0) {
|
|
77126
|
+
rejectTypeArguments();
|
|
77127
|
+
const parameterTypes = callee.params.map((parameter4) => {
|
|
77128
|
+
if (parameter4.type === null) {
|
|
77129
|
+
throw new CompileError(
|
|
77130
|
+
"An immediately invoked lambda requires explicit parameter types.",
|
|
77131
|
+
parameter4.pos
|
|
77132
|
+
);
|
|
77133
|
+
}
|
|
77134
|
+
return this.resolveType(parameter4.type);
|
|
77135
|
+
});
|
|
77136
|
+
return this.resolveDelegateCall(
|
|
77137
|
+
this.resolveDelegateLambda(
|
|
77138
|
+
callee,
|
|
77139
|
+
{
|
|
77140
|
+
kind: "delegate",
|
|
77141
|
+
parameterTypes,
|
|
77142
|
+
returnType: expected
|
|
77143
|
+
},
|
|
77144
|
+
scope
|
|
77145
|
+
),
|
|
77146
|
+
argumentsList2,
|
|
77147
|
+
scope,
|
|
77148
|
+
pos,
|
|
77149
|
+
false
|
|
77150
|
+
);
|
|
77151
|
+
}
|
|
76827
77152
|
const variantCall = this.resolveVariantCall(
|
|
76828
77153
|
callee,
|
|
76829
77154
|
argumentsList2,
|
|
@@ -90569,7 +90894,7 @@ var init_neoscript_language_context_adapter = __esm({
|
|
|
90569
90894
|
init_dialogue_types();
|
|
90570
90895
|
init_dialogue_group_language();
|
|
90571
90896
|
init_analyzer_types();
|
|
90572
|
-
NEOSCRIPT_COMPILER_ADAPTER_REVISION =
|
|
90897
|
+
NEOSCRIPT_COMPILER_ADAPTER_REVISION = 8;
|
|
90573
90898
|
UNKNOWN_TYPE2 = {
|
|
90574
90899
|
kind: "primitive",
|
|
90575
90900
|
name: "unknown"
|
|
@@ -91206,6 +91531,7 @@ function compileMemberInitializerBody(args) {
|
|
|
91206
91531
|
const returnTypeInfo = resolveMemberDeclaredTypeInfo(
|
|
91207
91532
|
args.member,
|
|
91208
91533
|
members2,
|
|
91534
|
+
args.classes,
|
|
91209
91535
|
args.thisClass
|
|
91210
91536
|
);
|
|
91211
91537
|
if (returnTypeInfo === null) {
|
|
@@ -91253,7 +91579,8 @@ function compileValueRowInitializerBody(args) {
|
|
|
91253
91579
|
}
|
|
91254
91580
|
const returnTypeInfo = resolveMemberDeclaredTypeInfo(
|
|
91255
91581
|
args.member,
|
|
91256
|
-
args.members
|
|
91582
|
+
args.members,
|
|
91583
|
+
args.classes
|
|
91257
91584
|
);
|
|
91258
91585
|
if (returnTypeInfo === null) {
|
|
91259
91586
|
throw new Error(
|
|
@@ -91436,6 +91763,7 @@ function compileConstructorBaseInitializerFields(args, owner) {
|
|
|
91436
91763
|
const declaredTypeInfo = resolveMemberDeclaredTypeInfo(
|
|
91437
91764
|
member,
|
|
91438
91765
|
args.members,
|
|
91766
|
+
args.classes,
|
|
91439
91767
|
args.classes.find(
|
|
91440
91768
|
(schemaClass2) => schemaClass2.id === entry.ownerClassId
|
|
91441
91769
|
) ?? null
|
|
@@ -98604,10 +98932,8 @@ function knownGeneratorExpression(expression, scope, environment) {
|
|
|
98604
98932
|
function validateExpression(expression, expected, scope, environment, uri, range2, diagnostics, anchor, storedValue = true) {
|
|
98605
98933
|
const sourceOnly = expected !== void 0 && (isNeoVariantTypeName(expected.name) || expected.name === "NeoAction" || expected.name === "ImageRef");
|
|
98606
98934
|
let receiver = expression;
|
|
98607
|
-
|
|
98608
|
-
|
|
98609
|
-
}
|
|
98610
|
-
const computed = environment.checkComputedInitializers && !sourceOnly && (expression.kind === "member" && (receiver.kind !== "ident" || receiver.typeQualifier !== void 0) || [
|
|
98935
|
+
while (receiver.kind === "member") receiver = receiver.receiver;
|
|
98936
|
+
const computed = (environment.checkComputedInitializers || expected?.name === "NeoDelegate") && !sourceOnly && (expression.kind === "member" && (receiver.kind !== "ident" || receiver.typeQualifier !== void 0) || [
|
|
98611
98937
|
"binary",
|
|
98612
98938
|
"unary",
|
|
98613
98939
|
"force",
|
|
@@ -99222,7 +99548,7 @@ function validateStoredExpression(expression, expected, scope, environment, uri,
|
|
|
99222
99548
|
}
|
|
99223
99549
|
expression.args.forEach((argument2, index) => {
|
|
99224
99550
|
const authoredName = expression.argumentNames?.[index];
|
|
99225
|
-
const named = declaration.name === NEO_LOOKUP_VARIANT_FOLDER_TYPE_NAME ? authoredName ?? NEO_LOOKUP_VARIANT_FOLDER_CONSTRUCTOR_ARGUMENTS[index]?.name : authoredName;
|
|
99551
|
+
const named = declaration.name === NEO_LOOKUP_VARIANT_FOLDER_TYPE_NAME ? authoredName ?? NEO_LOOKUP_VARIANT_FOLDER_CONSTRUCTOR_ARGUMENTS[index]?.name : authoredName ?? parameters?.[index]?.name;
|
|
99226
99552
|
if (declaration.name === NEO_LOOKUP_VARIANT_FOLDER_TYPE_NAME && named === "collection") {
|
|
99227
99553
|
return;
|
|
99228
99554
|
}
|
|
@@ -99255,7 +99581,7 @@ function validateStoredExpression(expression, expected, scope, environment, uri,
|
|
|
99255
99581
|
entry,
|
|
99256
99582
|
void 0,
|
|
99257
99583
|
scope,
|
|
99258
|
-
environment,
|
|
99584
|
+
{ ...environment, variantSelectorThis: siteTypeArguments[0] },
|
|
99259
99585
|
uri,
|
|
99260
99586
|
range2,
|
|
99261
99587
|
diagnostics,
|
|
@@ -99307,11 +99633,12 @@ function validateStoredExpression(expression, expected, scope, environment, uri,
|
|
|
99307
99633
|
return;
|
|
99308
99634
|
}
|
|
99309
99635
|
}
|
|
99636
|
+
const selectorThis = declaration.name === NEO_ANIMATION_CHILD_OVERRIDE_TYPE_NAME && named === "selector" ? environment.variantSelectorThis : void 0;
|
|
99310
99637
|
validateExpression(
|
|
99311
99638
|
argument2,
|
|
99312
99639
|
expectedSemanticType,
|
|
99313
|
-
scope,
|
|
99314
|
-
environment,
|
|
99640
|
+
selectorThis === void 0 ? scope : new Map(scope).set("this", selectorThis),
|
|
99641
|
+
selectorThis === void 0 ? environment : { ...environment, staticMember: false },
|
|
99315
99642
|
uri,
|
|
99316
99643
|
range2,
|
|
99317
99644
|
diagnostics,
|
|
@@ -101910,6 +102237,29 @@ function buildProjectGraph(documents) {
|
|
|
101910
102237
|
rootType
|
|
101911
102238
|
];
|
|
101912
102239
|
const globals = [];
|
|
102240
|
+
const variants = [];
|
|
102241
|
+
for (const entries of buildNeoVariantScopeIndex(
|
|
102242
|
+
documents
|
|
102243
|
+
).variantsByScope.values()) {
|
|
102244
|
+
for (const entry of entries) {
|
|
102245
|
+
const classId = graph.typeIdsByName.byName.get(entry.className);
|
|
102246
|
+
if (classId === void 0) continue;
|
|
102247
|
+
const folder = entry.scope.slice(`${entry.className}.${NEO_VARIANT_SCOPE_NAME}`.length + 1).split(".").join("/");
|
|
102248
|
+
const valueType = entry.declaration.type.typeArguments[1];
|
|
102249
|
+
const valueTypeId = valueType === void 0 ? void 0 : graph.typeIdsByName.byName.get(valueType.name);
|
|
102250
|
+
variants.push({
|
|
102251
|
+
id: sourceIdentity2(
|
|
102252
|
+
entry.declaration.annotations,
|
|
102253
|
+
`variant:${entry.uri}:${entry.className}:${entry.scope}:${entry.name}`
|
|
102254
|
+
),
|
|
102255
|
+
classId,
|
|
102256
|
+
name: entry.name,
|
|
102257
|
+
folder: folder.length === 0 ? null : folder,
|
|
102258
|
+
...valueTypeId === void 0 ? {} : { valueTypeId },
|
|
102259
|
+
location: location(entry.uri, entry.declaration.nameRange)
|
|
102260
|
+
});
|
|
102261
|
+
}
|
|
102262
|
+
}
|
|
101913
102263
|
const extensions = [];
|
|
101914
102264
|
const memberInfo = new Map(graph.memberInfo);
|
|
101915
102265
|
const roots = [];
|
|
@@ -101963,7 +102313,7 @@ function buildProjectGraph(documents) {
|
|
|
101963
102313
|
return {
|
|
101964
102314
|
...graph,
|
|
101965
102315
|
memberInfo,
|
|
101966
|
-
project: { ...graph.project, types, globals, roots, extensions }
|
|
102316
|
+
project: { ...graph.project, types, globals, roots, extensions, variants }
|
|
101967
102317
|
};
|
|
101968
102318
|
}
|
|
101969
102319
|
function buildDeclarationGraph(documents) {
|
|
@@ -102952,6 +103302,7 @@ var init_project_source_script_compiler = __esm({
|
|
|
102952
103302
|
init_project_root();
|
|
102953
103303
|
init_function_overload_identity();
|
|
102954
103304
|
init_project_source_registry();
|
|
103305
|
+
init_project_source_variants();
|
|
102955
103306
|
init_compilation_product();
|
|
102956
103307
|
init_runtime_source();
|
|
102957
103308
|
init_lexer();
|
|
@@ -123991,6 +124342,14 @@ function isNamePath(expression) {
|
|
|
123991
124342
|
return expression.kind === "member" && isNamePath(expression.receiver);
|
|
123992
124343
|
}
|
|
123993
124344
|
function isLiteralCall(expression) {
|
|
124345
|
+
if (expression.callee.kind === "member" && expression.callee.name === "Bind") {
|
|
124346
|
+
let receiver = expression.callee.receiver;
|
|
124347
|
+
while (receiver.kind === "member") {
|
|
124348
|
+
if (receiver.name === "Variants" && isNamePath(receiver.receiver))
|
|
124349
|
+
return true;
|
|
124350
|
+
receiver = receiver.receiver;
|
|
124351
|
+
}
|
|
124352
|
+
}
|
|
123994
124353
|
if (expression.callee.kind === "ident" && expression.callee.name === "Reference") {
|
|
123995
124354
|
if (expression.argumentNames?.some((name) => name !== null)) return true;
|
|
123996
124355
|
const [place] = expression.args;
|
|
@@ -128194,7 +128553,8 @@ function lowerBindings(context, ownerClass, ownerParameters, ownerRecordId, para
|
|
|
128194
128553
|
continue;
|
|
128195
128554
|
}
|
|
128196
128555
|
const baseBinding = baseArguments?.[parameterId];
|
|
128197
|
-
const
|
|
128556
|
+
const derive = isPendingId(ownerRecordId) || isPendingId(parameterId) ? pendingGenericArgumentMemberId : derivedGenericArgumentMemberId;
|
|
128557
|
+
const memberId = baseBinding?.kind === "member" ? baseBinding.memberId : derive(ownerRecordId, parameterId);
|
|
128198
128558
|
result[parameterId] = { kind: "member", memberId };
|
|
128199
128559
|
lowerGenericArgument(
|
|
128200
128560
|
context,
|
|
@@ -128848,6 +129208,7 @@ var init_lower_members = __esm({
|
|
|
128848
129208
|
init_ui_action_source();
|
|
128849
129209
|
init_entry_member_id();
|
|
128850
129210
|
init_generic_argument_member_id();
|
|
129211
|
+
init_pending_id();
|
|
128851
129212
|
init_structured_leaf_source();
|
|
128852
129213
|
init_member_kind_type_names();
|
|
128853
129214
|
init_set_literal_duplicates();
|
|
@@ -135329,6 +135690,59 @@ var init_dialogue_lower = __esm({
|
|
|
135329
135690
|
}
|
|
135330
135691
|
});
|
|
135331
135692
|
|
|
135693
|
+
// src/project-source/identity-rewriter.ts
|
|
135694
|
+
function createIdentityRewriter(assignments, onReplace) {
|
|
135695
|
+
if (assignments.size === 0) return (value) => value;
|
|
135696
|
+
const root = { children: /* @__PURE__ */ new Map() };
|
|
135697
|
+
for (const [source, replacement] of assignments) {
|
|
135698
|
+
let prefix = root;
|
|
135699
|
+
for (let index = 0; index < source.length; index += 1) {
|
|
135700
|
+
const character = source[index];
|
|
135701
|
+
let child2 = prefix.children.get(character);
|
|
135702
|
+
if (child2 === void 0) {
|
|
135703
|
+
child2 = { children: /* @__PURE__ */ new Map() };
|
|
135704
|
+
prefix.children.set(character, child2);
|
|
135705
|
+
}
|
|
135706
|
+
prefix = child2;
|
|
135707
|
+
}
|
|
135708
|
+
prefix.replacement = replacement;
|
|
135709
|
+
}
|
|
135710
|
+
return (value) => {
|
|
135711
|
+
const exact = assignments.get(value);
|
|
135712
|
+
if (exact !== void 0) {
|
|
135713
|
+
onReplace?.(value);
|
|
135714
|
+
return exact;
|
|
135715
|
+
}
|
|
135716
|
+
const parts = [];
|
|
135717
|
+
let copiedThrough = 0;
|
|
135718
|
+
for (let start = 0; start < value.length; start += 1) {
|
|
135719
|
+
let prefix = root.children.get(value[start]);
|
|
135720
|
+
let replacement;
|
|
135721
|
+
let end = start;
|
|
135722
|
+
for (let index = start; prefix !== void 0; index += 1) {
|
|
135723
|
+
if (prefix.replacement !== void 0) {
|
|
135724
|
+
replacement = prefix.replacement;
|
|
135725
|
+
end = index + 1;
|
|
135726
|
+
}
|
|
135727
|
+
prefix = prefix.children.get(value[index + 1]);
|
|
135728
|
+
}
|
|
135729
|
+
if (replacement === void 0) continue;
|
|
135730
|
+
onReplace?.(value.slice(start, end));
|
|
135731
|
+
parts.push(value.slice(copiedThrough, start), replacement);
|
|
135732
|
+
copiedThrough = end;
|
|
135733
|
+
start = end - 1;
|
|
135734
|
+
}
|
|
135735
|
+
if (copiedThrough === 0) return value;
|
|
135736
|
+
parts.push(value.slice(copiedThrough));
|
|
135737
|
+
return parts.join("");
|
|
135738
|
+
};
|
|
135739
|
+
}
|
|
135740
|
+
var init_identity_rewriter = __esm({
|
|
135741
|
+
"src/project-source/identity-rewriter.ts"() {
|
|
135742
|
+
"use strict";
|
|
135743
|
+
}
|
|
135744
|
+
});
|
|
135745
|
+
|
|
135332
135746
|
// ../src/database/document-initializer-compiler.ts
|
|
135333
135747
|
function initializerCompilerState(document, compilationProject) {
|
|
135334
135748
|
const existing = documentInitializerCompilerStates.get(document);
|
|
@@ -135353,7 +135767,9 @@ function compilationProjectForDocument(document, state) {
|
|
|
135353
135767
|
classes: document.classes,
|
|
135354
135768
|
enums: document.enums,
|
|
135355
135769
|
interfaces: document.interfaces,
|
|
135356
|
-
constructors: document.constructors ?? []
|
|
135770
|
+
constructors: document.constructors ?? [],
|
|
135771
|
+
variants: document.variants ?? [],
|
|
135772
|
+
variantFolders: document.variantFolders ?? []
|
|
135357
135773
|
});
|
|
135358
135774
|
return state.compilationProject;
|
|
135359
135775
|
}
|
|
@@ -135452,6 +135868,8 @@ function compileValueInitializerDependency(document, valueId, compilationProject
|
|
|
135452
135868
|
enums: document.enums,
|
|
135453
135869
|
interfaces: document.interfaces,
|
|
135454
135870
|
constructors: document.constructors ?? [],
|
|
135871
|
+
variants: document.variants ?? [],
|
|
135872
|
+
variantFolders: document.variantFolders ?? [],
|
|
135455
135873
|
member: site.member,
|
|
135456
135874
|
valueRow: { ...site.row },
|
|
135457
135875
|
valueId: site.row.id,
|
|
@@ -135470,7 +135888,9 @@ function compileMemberInitializerDependency(document, memberId, compilationProje
|
|
|
135470
135888
|
classes: document.classes,
|
|
135471
135889
|
enums: document.enums,
|
|
135472
135890
|
interfaces: document.interfaces,
|
|
135473
|
-
constructors: document.constructors ?? []
|
|
135891
|
+
constructors: document.constructors ?? [],
|
|
135892
|
+
variants: document.variants ?? [],
|
|
135893
|
+
variantFolders: document.variantFolders ?? []
|
|
135474
135894
|
};
|
|
135475
135895
|
const memberIndex = documentMemberCompilationIndex(document);
|
|
135476
135896
|
const member = memberIndex.membersById.get(memberId);
|
|
@@ -146026,6 +146446,7 @@ function appendAuthoredOwnedValueCascadeDeletes(args) {
|
|
|
146026
146446
|
while (parentId != null && !visited.has(parentId)) {
|
|
146027
146447
|
visited.add(parentId);
|
|
146028
146448
|
const parent = postValuesById.get(parentId);
|
|
146449
|
+
if (isInitValueContent(parent)) break;
|
|
146029
146450
|
if (parent !== void 0 && isLiteralValueContent(parent) && isVirtualInstanceRootShape(parent) && postPlacements.has(parentId)) {
|
|
146030
146451
|
survivingConstructionIds.add(parentId);
|
|
146031
146452
|
break;
|
|
@@ -146736,6 +147157,7 @@ function* prepareServerOwnedSchemaCommitPasses(args) {
|
|
|
146736
147157
|
appendConstructionTypes
|
|
146737
147158
|
});
|
|
146738
147159
|
materializePreparedInstanceInitializers({
|
|
147160
|
+
referenceOwners: args.initializerReferenceOwners,
|
|
146739
147161
|
document: args.document,
|
|
146740
147162
|
physicalValues: args.document.physicalValues,
|
|
146741
147163
|
prepared,
|
|
@@ -147087,7 +147509,8 @@ function materializePreparedInstanceInitializers(args) {
|
|
|
147087
147509
|
if (pendingInitializerIds.size === 0) return;
|
|
147088
147510
|
const batch = createInitializerMaterializationBatch(
|
|
147089
147511
|
materializationScope.document,
|
|
147090
|
-
pendingInitializerIds
|
|
147512
|
+
pendingInitializerIds,
|
|
147513
|
+
args.referenceOwners
|
|
147091
147514
|
);
|
|
147092
147515
|
materializeInitializerDependencies(pendingInitializerIds, (valueId) => {
|
|
147093
147516
|
const site = pendingSites.get(valueId);
|
|
@@ -149271,6 +149694,8 @@ function compileOwnedValueRowInitializer(args) {
|
|
|
149271
149694
|
enums: document.enums,
|
|
149272
149695
|
interfaces: document.interfaces,
|
|
149273
149696
|
constructors: document.constructors ?? [],
|
|
149697
|
+
variants: document.variants ?? [],
|
|
149698
|
+
variantFolders: document.variantFolders ?? [],
|
|
149274
149699
|
compilationProject: args.compilationProject,
|
|
149275
149700
|
member,
|
|
149276
149701
|
valueRow: row,
|
|
@@ -149336,7 +149761,9 @@ function prepareServerOwnedValueInitializerBodies(args) {
|
|
|
149336
149761
|
classes: document.classes,
|
|
149337
149762
|
enums: document.enums,
|
|
149338
149763
|
interfaces: document.interfaces,
|
|
149339
|
-
constructors: document.constructors ?? []
|
|
149764
|
+
constructors: document.constructors ?? [],
|
|
149765
|
+
variants: document.variants ?? [],
|
|
149766
|
+
variantFolders: document.variantFolders ?? []
|
|
149340
149767
|
});
|
|
149341
149768
|
compilationProjects.set(document, compilationProject);
|
|
149342
149769
|
return compilationProject;
|
|
@@ -149499,7 +149926,9 @@ function compileInlineDelegateConstructorArguments(args) {
|
|
|
149499
149926
|
);
|
|
149500
149927
|
}
|
|
149501
149928
|
const env = isClassSlotMember(ownerMember) ? slotRowEnv(ownerMember, row, document).env : resolveInstanceEnv(classId, void 0, document.classes);
|
|
149502
|
-
const
|
|
149929
|
+
for (const [paramId, memberId] of Object.entries(row.genericBindings ?? {})) {
|
|
149930
|
+
env.set(paramId, { kind: "member", memberId });
|
|
149931
|
+
}
|
|
149503
149932
|
const compiled = { ...constructorArgs2 };
|
|
149504
149933
|
for (const [argumentKey, argument2] of Object.entries(constructorArgs2)) {
|
|
149505
149934
|
if (!isUncompiledInlineDelegateArgument(argument2)) continue;
|
|
@@ -149546,7 +149975,7 @@ function compileInlineDelegateConstructorArguments(args) {
|
|
|
149546
149975
|
constructors: document.constructors ?? [],
|
|
149547
149976
|
variants: document.variants ?? [],
|
|
149548
149977
|
variantFolders: document.variantFolders ?? [],
|
|
149549
|
-
thisClass,
|
|
149978
|
+
thisClass: args.thisClassForMember(settledMember),
|
|
149550
149979
|
returnTypeInfo: substituted.returnTypeInfo,
|
|
149551
149980
|
argumentTypes: substituted.argumentTypes,
|
|
149552
149981
|
name: `${settledMember.name} argument`,
|
|
@@ -149627,6 +150056,29 @@ function compileValueBodies(args) {
|
|
|
149627
150056
|
function createDelegateValueBodyCompiler(postDocument, targetIds, prepared) {
|
|
149628
150057
|
const scope = prepared ?? delegateValueBodyOwnership(postDocument, targetIds);
|
|
149629
150058
|
const { ownerByValueId, rootOwnerByValueId } = scope;
|
|
150059
|
+
const variantSelectorScopes = /* @__PURE__ */ new WeakMap();
|
|
150060
|
+
const thisClassForMember = (document, rootOwner, memberId) => {
|
|
150061
|
+
let selectors = variantSelectorScopes.get(document);
|
|
150062
|
+
if (selectors === void 0) {
|
|
150063
|
+
const classes = new Map(document.classes.map((type2) => [type2.id, type2]));
|
|
150064
|
+
const selectorId = document.classes.find(
|
|
150065
|
+
(type2) => type2.system?.worldKind === "animationChildOverride"
|
|
150066
|
+
)?.schema.Selector;
|
|
150067
|
+
const targets = /* @__PURE__ */ new Map();
|
|
150068
|
+
for (const variant2 of document.variants ?? []) {
|
|
150069
|
+
const target = classes.get(variant2.classId);
|
|
150070
|
+
if (target !== void 0)
|
|
150071
|
+
targets.set(variantRootMemberId(variant2.id), target);
|
|
150072
|
+
}
|
|
150073
|
+
selectors = { selectorId, targets };
|
|
150074
|
+
variantSelectorScopes.set(document, selectors);
|
|
150075
|
+
}
|
|
150076
|
+
if (memberId !== void 0 && memberId === selectors.selectorId && rootOwner !== void 0) {
|
|
150077
|
+
const target = selectors.targets.get(rootOwner.id);
|
|
150078
|
+
if (target !== void 0) return target;
|
|
150079
|
+
}
|
|
150080
|
+
return findSchemaPlacement(rootOwner?.id ?? "", document.classes)?.ownerClass ?? null;
|
|
150081
|
+
};
|
|
149630
150082
|
const compilationProjects = /* @__PURE__ */ new WeakMap();
|
|
149631
150083
|
if (prepared !== void 0)
|
|
149632
150084
|
compilationProjects.set(prepared.document, prepared.compilationProject);
|
|
@@ -149647,7 +150099,11 @@ function createDelegateValueBodyCompiler(postDocument, targetIds, prepared) {
|
|
|
149647
150099
|
);
|
|
149648
150100
|
}
|
|
149649
150101
|
const rootOwner = rootOwnerByValueId.get(row.id);
|
|
149650
|
-
const thisClass =
|
|
150102
|
+
const thisClass = thisClassForMember(
|
|
150103
|
+
document,
|
|
150104
|
+
rootOwner,
|
|
150105
|
+
getOptionalString(member, "id")
|
|
150106
|
+
);
|
|
149651
150107
|
const compiled = { ...row, value: { ...row.value } };
|
|
149652
150108
|
try {
|
|
149653
150109
|
compiled.value = compileDelegateClosureValue(row.value.code, {
|
|
@@ -149687,6 +150143,7 @@ function createDelegateValueBodyCompiler(postDocument, targetIds, prepared) {
|
|
|
149687
150143
|
row,
|
|
149688
150144
|
ownerMember: ownerByValueId.get(row.id),
|
|
149689
150145
|
rootOwner: rootOwnerByValueId.get(row.id) ?? null,
|
|
150146
|
+
thisClassForMember: (member) => thisClassForMember(document, rootOwnerByValueId.get(row.id), member.id),
|
|
149690
150147
|
compilationProject: compilationProjectFor(document)
|
|
149691
150148
|
});
|
|
149692
150149
|
const ownershipIds = (valueId) => ({
|
|
@@ -152997,12 +153454,12 @@ function assertNoVariantTypePositions(args) {
|
|
|
152997
153454
|
for (const declaredConstructor of args.constructors ?? []) {
|
|
152998
153455
|
const ids = [];
|
|
152999
153456
|
for (const argument2 of declaredConstructor.argumentTypes ?? []) {
|
|
153000
|
-
typeInfoClassIds(argument2, ids, args.classesById);
|
|
153457
|
+
typeInfoClassIds(argument2, ids, args.classesById, true);
|
|
153001
153458
|
}
|
|
153002
153459
|
for (const classId of ids) {
|
|
153003
153460
|
if (!isVariantFamilyClassId(classId, args.classesById)) continue;
|
|
153004
153461
|
throw new Error(
|
|
153005
|
-
`Constructor "${declaredConstructor.id}" declares a parameter of ${variantFamilyLabel(classId, args.classesById)}, which
|
|
153462
|
+
`Constructor "${declaredConstructor.id}" declares a parameter of ${variantFamilyLabel(classId, args.classesById)}, which cannot be used as a constructor argument type.`
|
|
153006
153463
|
);
|
|
153007
153464
|
}
|
|
153008
153465
|
}
|
|
@@ -158355,7 +158812,10 @@ function assertStagedVariantMemberValuesValid(projected, changes) {
|
|
|
158355
158812
|
const variantMembers = projected.members.filter(
|
|
158356
158813
|
(member) => member.kind === 27 /* Variant */
|
|
158357
158814
|
);
|
|
158358
|
-
if (variantMembers.length === 0
|
|
158815
|
+
if (variantMembers.length === 0 && !projected.values.some(
|
|
158816
|
+
(row) => isLiteralValueContent(row) && row.constructorArgs != null
|
|
158817
|
+
))
|
|
158818
|
+
return;
|
|
158359
158819
|
const classesById = new Map(
|
|
158360
158820
|
projected.classes.map((schemaClass2) => [schemaClass2.id, schemaClass2])
|
|
158361
158821
|
);
|
|
@@ -158433,6 +158893,46 @@ function assertStagedVariantMemberValuesValid(projected, changes) {
|
|
|
158433
158893
|
});
|
|
158434
158894
|
}
|
|
158435
158895
|
}
|
|
158896
|
+
let constructorGraph;
|
|
158897
|
+
for (const row of projected.values) {
|
|
158898
|
+
if (!isLiteralValueContent(row) || row.constructorArgs == null) continue;
|
|
158899
|
+
constructorGraph ??= new MaterializedValueGraphContext(
|
|
158900
|
+
projected,
|
|
158901
|
+
valuesById
|
|
158902
|
+
);
|
|
158903
|
+
for (const [
|
|
158904
|
+
parameterId,
|
|
158905
|
+
typeInfo
|
|
158906
|
+
] of constructorGraph.constructorParameterTypes(row)) {
|
|
158907
|
+
if (typeInfo.type !== 7 /* Class */) continue;
|
|
158908
|
+
const systemClass = classesById.get(typeInfo.classId);
|
|
158909
|
+
const worldKind = systemClass?.system?.worldKind;
|
|
158910
|
+
if (worldKind !== NeoWorldSystemClassKind.Variant && worldKind !== NeoWorldSystemClassKind.LookupVariant)
|
|
158911
|
+
continue;
|
|
158912
|
+
const label = `Constructor argument "${parameterId}" of row "${row.id}"`;
|
|
158913
|
+
const targetParamId = systemClass?.genericParams?.[0]?.id;
|
|
158914
|
+
const targetTypeInfo = targetParamId === void 0 ? void 0 : typeInfo.typeArguments?.[targetParamId];
|
|
158915
|
+
if (targetTypeInfo === void 0)
|
|
158916
|
+
throw new Error(`${label} declares no variant target type.`);
|
|
158917
|
+
const valueParamId = systemClass?.genericParams?.[1]?.id;
|
|
158918
|
+
const valueTypeInfo = valueParamId === void 0 ? void 0 : typeInfo.typeArguments?.[valueParamId];
|
|
158919
|
+
if (worldKind === NeoWorldSystemClassKind.LookupVariant && valueTypeInfo === void 0)
|
|
158920
|
+
throw new Error(`${label} declares no lookup value type.`);
|
|
158921
|
+
const declaration = {
|
|
158922
|
+
kind: 27 /* Variant */,
|
|
158923
|
+
name: parameterId,
|
|
158924
|
+
targetTypeInfo,
|
|
158925
|
+
...valueTypeInfo === void 0 ? {} : { valueTypeInfo },
|
|
158926
|
+
...typeInfo.required ? { requirement: 1 /* Required */ } : {}
|
|
158927
|
+
};
|
|
158928
|
+
assertVariantMemberTargetValid({ declaration, label, classesById });
|
|
158929
|
+
graded.push({
|
|
158930
|
+
value: row.constructorArgs[parameterId],
|
|
158931
|
+
declaration,
|
|
158932
|
+
label
|
|
158933
|
+
});
|
|
158934
|
+
}
|
|
158935
|
+
}
|
|
158436
158936
|
for (const entry of graded) {
|
|
158437
158937
|
assertVariantReferenceValid({
|
|
158438
158938
|
value: entry.value,
|
|
@@ -158733,7 +159233,14 @@ var init_project_version_whole_graph_validation = __esm({
|
|
|
158733
159233
|
25 /* NSDelegate */,
|
|
158734
159234
|
26 /* NSAction */
|
|
158735
159235
|
]);
|
|
158736
|
-
VARIANT_MEMBER_TRIGGER_RECORD_KINDS = /* @__PURE__ */ new Set([
|
|
159236
|
+
VARIANT_MEMBER_TRIGGER_RECORD_KINDS = /* @__PURE__ */ new Set([
|
|
159237
|
+
"member",
|
|
159238
|
+
"class",
|
|
159239
|
+
"constructor",
|
|
159240
|
+
"value",
|
|
159241
|
+
"variant",
|
|
159242
|
+
"variant-folder"
|
|
159243
|
+
]);
|
|
158737
159244
|
}
|
|
158738
159245
|
});
|
|
158739
159246
|
|
|
@@ -158813,6 +159320,7 @@ function preparationArgs(context) {
|
|
|
158813
159320
|
const { args } = context;
|
|
158814
159321
|
return {
|
|
158815
159322
|
document: context.document,
|
|
159323
|
+
initializerReferenceOwners: args.initializerReferenceOwners,
|
|
158816
159324
|
contentHashHeads: context.contentHashHeads,
|
|
158817
159325
|
changes: args.changes,
|
|
158818
159326
|
authoredValueSeeds: args.authoredValueSeeds,
|
|
@@ -159308,56 +159816,18 @@ var init_client_commit_preparation = __esm({
|
|
|
159308
159816
|
}
|
|
159309
159817
|
});
|
|
159310
159818
|
|
|
159311
|
-
// src/
|
|
159312
|
-
function
|
|
159313
|
-
|
|
159314
|
-
const root = { children: /* @__PURE__ */ new Map() };
|
|
159315
|
-
for (const [source, replacement] of assignments) {
|
|
159316
|
-
let prefix = root;
|
|
159317
|
-
for (let index = 0; index < source.length; index += 1) {
|
|
159318
|
-
const character = source[index];
|
|
159319
|
-
let child2 = prefix.children.get(character);
|
|
159320
|
-
if (child2 === void 0) {
|
|
159321
|
-
child2 = { children: /* @__PURE__ */ new Map() };
|
|
159322
|
-
prefix.children.set(character, child2);
|
|
159323
|
-
}
|
|
159324
|
-
prefix = child2;
|
|
159325
|
-
}
|
|
159326
|
-
prefix.replacement = replacement;
|
|
159327
|
-
}
|
|
159328
|
-
return (value) => {
|
|
159329
|
-
const exact = assignments.get(value);
|
|
159330
|
-
if (exact !== void 0) {
|
|
159331
|
-
onReplace?.(value);
|
|
159332
|
-
return exact;
|
|
159333
|
-
}
|
|
159334
|
-
const parts = [];
|
|
159335
|
-
let copiedThrough = 0;
|
|
159336
|
-
for (let start = 0; start < value.length; start += 1) {
|
|
159337
|
-
let prefix = root.children.get(value[start]);
|
|
159338
|
-
let replacement;
|
|
159339
|
-
let end = start;
|
|
159340
|
-
for (let index = start; prefix !== void 0; index += 1) {
|
|
159341
|
-
if (prefix.replacement !== void 0) {
|
|
159342
|
-
replacement = prefix.replacement;
|
|
159343
|
-
end = index + 1;
|
|
159344
|
-
}
|
|
159345
|
-
prefix = prefix.children.get(value[index + 1]);
|
|
159346
|
-
}
|
|
159347
|
-
if (replacement === void 0) continue;
|
|
159348
|
-
onReplace?.(value.slice(start, end));
|
|
159349
|
-
parts.push(value.slice(copiedThrough, start), replacement);
|
|
159350
|
-
copiedThrough = end;
|
|
159351
|
-
start = end - 1;
|
|
159352
|
-
}
|
|
159353
|
-
if (copiedThrough === 0) return value;
|
|
159354
|
-
parts.push(value.slice(copiedThrough));
|
|
159355
|
-
return parts.join("");
|
|
159356
|
-
};
|
|
159819
|
+
// ../src/models/members/animation-child-binding-id.ts
|
|
159820
|
+
function pendingAnimationChildBindingMemberId(classId) {
|
|
159821
|
+
return `${PREFIX}${encodeURIComponent(classId)}`;
|
|
159357
159822
|
}
|
|
159358
|
-
|
|
159359
|
-
|
|
159823
|
+
function pendingAnimationChildBindingClassId(token) {
|
|
159824
|
+
return token.startsWith(PREFIX) ? decodeURIComponent(token.slice(PREFIX.length)) : null;
|
|
159825
|
+
}
|
|
159826
|
+
var PREFIX;
|
|
159827
|
+
var init_animation_child_binding_id = __esm({
|
|
159828
|
+
"../src/models/members/animation-child-binding-id.ts"() {
|
|
159360
159829
|
"use strict";
|
|
159830
|
+
PREFIX = "__pending__:animation-child-binding:";
|
|
159361
159831
|
}
|
|
159362
159832
|
});
|
|
159363
159833
|
|
|
@@ -159559,6 +160029,29 @@ function validateAssignments(value) {
|
|
|
159559
160029
|
return assignments;
|
|
159560
160030
|
}
|
|
159561
160031
|
function derivedAssignment(pendingId2) {
|
|
160032
|
+
const animationClass = pendingAnimationChildBindingClassId(pendingId2);
|
|
160033
|
+
if (animationClass !== null)
|
|
160034
|
+
return {
|
|
160035
|
+
ownerLocator: animationClass,
|
|
160036
|
+
derive: worldAnimationChildOverrideBindingMemberId,
|
|
160037
|
+
label: "Animation child binding assignment",
|
|
160038
|
+
ownerNoun: "class"
|
|
160039
|
+
};
|
|
160040
|
+
const genericArgument = pendingGenericArgumentIdentity(pendingId2);
|
|
160041
|
+
if (genericArgument !== null)
|
|
160042
|
+
return {
|
|
160043
|
+
ownerLocator: genericArgument.parentRecordId,
|
|
160044
|
+
derive: (parent, assignments) => {
|
|
160045
|
+
const parameter4 = isPendingId(genericArgument.genericParamId) ? assignments.get(genericArgument.genericParamId) : genericArgument.genericParamId;
|
|
160046
|
+
if (parameter4 === void 0)
|
|
160047
|
+
throw new ProjectSourceCommitVerificationError(
|
|
160048
|
+
`Generic argument assignment ${pendingId2} names parameter ${genericArgument.genericParamId}, which has no pending id assignment.`
|
|
160049
|
+
);
|
|
160050
|
+
return derivedGenericArgumentMemberId(parent, parameter4);
|
|
160051
|
+
},
|
|
160052
|
+
label: "Generic argument assignment",
|
|
160053
|
+
ownerNoun: "binding owner"
|
|
160054
|
+
};
|
|
159562
160055
|
const tupleElement = pendingTupleElementIdentity(pendingId2);
|
|
159563
160056
|
if (tupleElement !== null)
|
|
159564
160057
|
return {
|
|
@@ -159657,7 +160150,20 @@ function relocatedAssignment(pendingId2, assignments, byPosition, used) {
|
|
|
159657
160150
|
const key = positionIndependentPendingKey(pendingId2);
|
|
159658
160151
|
const relocated = key === null ? void 0 : byPosition.get(key);
|
|
159659
160152
|
if (relocated !== void 0) return relocated;
|
|
160153
|
+
const genericArgument = pendingGenericArgumentIdentity(pendingId2);
|
|
160154
|
+
if (genericArgument !== null) {
|
|
160155
|
+
const relocate = (id2) => !isPendingId(id2) || assignments.has(id2) ? id2 : relocatedAssignment(id2, assignments, byPosition, used);
|
|
160156
|
+
const parent = relocate(genericArgument.parentRecordId);
|
|
160157
|
+
const parameter4 = relocate(genericArgument.genericParamId);
|
|
160158
|
+
if (parent === null || parameter4 === null) return null;
|
|
160159
|
+
const rebuilt = pendingGenericArgumentMemberId(parent, parameter4);
|
|
160160
|
+
return assignments.has(rebuilt) ? rebuilt : null;
|
|
160161
|
+
}
|
|
159660
160162
|
for (const [owner, rebuild] of [
|
|
160163
|
+
[
|
|
160164
|
+
pendingAnimationChildBindingClassId(pendingId2),
|
|
160165
|
+
pendingAnimationChildBindingMemberId
|
|
160166
|
+
],
|
|
159661
160167
|
[pendingMemberValueMemberId(pendingId2), pendingMemberValueId],
|
|
159662
160168
|
[pendingEntryMemberDeclaringId(pendingId2), pendingEntryMemberId],
|
|
159663
160169
|
[
|
|
@@ -159987,8 +160493,11 @@ var ProjectSourceCommitVerificationError, ABSENT_DIFFERENCE_VALUE;
|
|
|
159987
160493
|
var init_trusted_commit_verification = __esm({
|
|
159988
160494
|
"src/project-source/trusted-commit-verification.ts"() {
|
|
159989
160495
|
"use strict";
|
|
160496
|
+
init_animation_child_binding_id();
|
|
160497
|
+
init_world_system_classes();
|
|
159990
160498
|
init_tuple_element_member_id();
|
|
159991
160499
|
init_identity_rewriter();
|
|
160500
|
+
init_generic_argument_member_id();
|
|
159992
160501
|
init_lower_support();
|
|
159993
160502
|
init_schema_source_validation();
|
|
159994
160503
|
init_projectRecordBuckets();
|
|
@@ -160062,6 +160571,7 @@ function sourceCommitPreparation(args) {
|
|
|
160062
160571
|
timestamp: args.serverTimestamp
|
|
160063
160572
|
}),
|
|
160064
160573
|
authoredValueSeeds: args.authoredValueSeeds,
|
|
160574
|
+
initializerReferenceOwners: args.initializerReferenceOwners,
|
|
160065
160575
|
forceRecompile: args.forceRecompile,
|
|
160066
160576
|
scriptSources: args.scriptSources,
|
|
160067
160577
|
serverTimestamp: args.serverTimestamp
|
|
@@ -160249,7 +160759,9 @@ function replayStoredConstructionV4(args) {
|
|
|
160249
160759
|
classes: document.classes,
|
|
160250
160760
|
enums: document.enums,
|
|
160251
160761
|
interfaces: document.interfaces,
|
|
160252
|
-
constructors: document.constructors ?? []
|
|
160762
|
+
constructors: document.constructors ?? [],
|
|
160763
|
+
variants: document.variants ?? [],
|
|
160764
|
+
variantFolders: document.variantFolders ?? []
|
|
160253
160765
|
}) : void 0);
|
|
160254
160766
|
if (args.compileDocumentBodies === true) {
|
|
160255
160767
|
if (compilationProject === void 0) {
|
|
@@ -160298,6 +160810,8 @@ function replayStoredConstructionV4(args) {
|
|
|
160298
160810
|
enums: document.enums,
|
|
160299
160811
|
interfaces: document.interfaces,
|
|
160300
160812
|
constructors: document.constructors,
|
|
160813
|
+
variants: document.variants ?? [],
|
|
160814
|
+
variantFolders: document.variantFolders ?? [],
|
|
160301
160815
|
member: compileMember,
|
|
160302
160816
|
valueRow: candidate,
|
|
160303
160817
|
valueId: args.valueId,
|
|
@@ -160369,7 +160883,9 @@ function compilePulledUncompiledConstructorsV4(document, compilationProject, rep
|
|
|
160369
160883
|
classes: document.classes,
|
|
160370
160884
|
enums: document.enums,
|
|
160371
160885
|
interfaces: document.interfaces,
|
|
160372
|
-
constructors: document.constructors ?? []
|
|
160886
|
+
constructors: document.constructors ?? [],
|
|
160887
|
+
variants: document.variants ?? [],
|
|
160888
|
+
variantFolders: document.variantFolders ?? []
|
|
160373
160889
|
});
|
|
160374
160890
|
const compileArgs = {
|
|
160375
160891
|
project: document.project,
|
|
@@ -160380,6 +160896,8 @@ function compilePulledUncompiledConstructorsV4(document, compilationProject, rep
|
|
|
160380
160896
|
enums: document.enums,
|
|
160381
160897
|
interfaces: document.interfaces,
|
|
160382
160898
|
constructors: document.constructors ?? [],
|
|
160899
|
+
variants: document.variants ?? [],
|
|
160900
|
+
variantFolders: document.variantFolders ?? [],
|
|
160383
160901
|
compilationProject: project
|
|
160384
160902
|
};
|
|
160385
160903
|
for (const constructor2 of uncompiled) {
|
|
@@ -160403,7 +160921,9 @@ function compilePulledProjectDocumentForEvaluationV4(document, compilationProjec
|
|
|
160403
160921
|
classes: document.classes,
|
|
160404
160922
|
enums: document.enums,
|
|
160405
160923
|
interfaces: document.interfaces,
|
|
160406
|
-
constructors: document.constructors ?? []
|
|
160924
|
+
constructors: document.constructors ?? [],
|
|
160925
|
+
variants: document.variants ?? [],
|
|
160926
|
+
variantFolders: document.variantFolders ?? []
|
|
160407
160927
|
});
|
|
160408
160928
|
documentInitializerCompiler(document, sharedCompilationProject);
|
|
160409
160929
|
const compileArgs = {
|
|
@@ -160415,6 +160935,8 @@ function compilePulledProjectDocumentForEvaluationV4(document, compilationProjec
|
|
|
160415
160935
|
enums: document.enums,
|
|
160416
160936
|
interfaces: document.interfaces,
|
|
160417
160937
|
constructors: document.constructors ?? [],
|
|
160938
|
+
variants: document.variants ?? [],
|
|
160939
|
+
variantFolders: document.variantFolders ?? [],
|
|
160418
160940
|
compilationProject: sharedCompilationProject
|
|
160419
160941
|
};
|
|
160420
160942
|
const constructors = document.constructors ?? [];
|
|
@@ -161570,6 +162092,9 @@ function buildValueEmitContext(records3, manifest, options = {}) {
|
|
|
161570
162092
|
dictionaryKeyOptions: /* @__PURE__ */ new Map(),
|
|
161571
162093
|
localizedTextIds: /* @__PURE__ */ new Set(),
|
|
161572
162094
|
constructionReplays: /* @__PURE__ */ new Map(),
|
|
162095
|
+
constructorOwnedArguments: /* @__PURE__ */ new Map(),
|
|
162096
|
+
constructorArgumentGraph: {},
|
|
162097
|
+
constructorRelations: /* @__PURE__ */ new WeakMap(),
|
|
161573
162098
|
constructorBodySchemaKeys: /* @__PURE__ */ new WeakMap(),
|
|
161574
162099
|
activeStoredConstructorArguments: /* @__PURE__ */ new Set(),
|
|
161575
162100
|
materializedConstructors: /* @__PURE__ */ new Map(),
|
|
@@ -162247,6 +162772,7 @@ function emitStoredConstructorExpression(context, member, valueId, visited = /*
|
|
|
162247
162772
|
context,
|
|
162248
162773
|
schemaClass2,
|
|
162249
162774
|
value,
|
|
162775
|
+
resolvedMember,
|
|
162250
162776
|
className,
|
|
162251
162777
|
environment,
|
|
162252
162778
|
visited,
|
|
@@ -162913,6 +163439,7 @@ function lowerVariantGraph(context, binding, created) {
|
|
|
162913
163439
|
const storedSource = {
|
|
162914
163440
|
memberId: rootMember.id,
|
|
162915
163441
|
purpose: "stored",
|
|
163442
|
+
variantTargetClassId: binding.targetClassId,
|
|
162916
163443
|
initializer: binding.initializer,
|
|
162917
163444
|
source: binding.source,
|
|
162918
163445
|
label: binding.label
|
|
@@ -163440,7 +163967,7 @@ function drainValueReferenceObligationsV4(state, manifest, options) {
|
|
|
163440
163967
|
...composeReferenceSitePosition(move.site, options.sourceTextByUri)
|
|
163441
163968
|
});
|
|
163442
163969
|
}
|
|
163443
|
-
for (const obligation of [
|
|
163970
|
+
for (const obligation of options.obligations ?? [
|
|
163444
163971
|
...collectionValueObligations(manifest),
|
|
163445
163972
|
...options.registry.referenceObligations
|
|
163446
163973
|
]) {
|
|
@@ -163460,11 +163987,29 @@ function drainValueReferenceObligationsV4(state, manifest, options) {
|
|
|
163460
163987
|
targetId = obligation.target.id;
|
|
163461
163988
|
else if (obligation.target.spelling === "symbol")
|
|
163462
163989
|
targetId = obligation.target.resolved.id;
|
|
163990
|
+
else if (obligation.target.spelling === "local")
|
|
163991
|
+
targetId = context.localValues.target(obligation.target.name);
|
|
163463
163992
|
break;
|
|
163464
163993
|
}
|
|
163465
163994
|
if (targetId !== void 0 && (options.unavailableValueIds?.has(targetId) === true || options.registry.refusedValueIds.has(targetId)))
|
|
163466
163995
|
continue;
|
|
163467
163996
|
}
|
|
163997
|
+
if (options.deferredReferences !== void 0 && obligation.kind === "reference") {
|
|
163998
|
+
const target = obligation.target;
|
|
163999
|
+
if (target.spelling === "local") {
|
|
164000
|
+
const id2 = context.localValues.target(target.name);
|
|
164001
|
+
if (context.pendingValueIdentitySites.get(id2)?.materializedLocation !== void 0) {
|
|
164002
|
+
target.patch.ids[target.patch.index] = id2;
|
|
164003
|
+
options.deferredReferences.push(obligation);
|
|
164004
|
+
continue;
|
|
164005
|
+
}
|
|
164006
|
+
} else if (target.spelling === "id") {
|
|
164007
|
+
if (referenceTargetById(context, target.id, target.typeName) === null) {
|
|
164008
|
+
options.deferredReferences.push(obligation);
|
|
164009
|
+
continue;
|
|
164010
|
+
}
|
|
164011
|
+
}
|
|
164012
|
+
}
|
|
163468
164013
|
const failure = settleReferenceObligation(
|
|
163469
164014
|
context,
|
|
163470
164015
|
obligation,
|
|
@@ -164404,12 +164949,11 @@ function constructorArgumentValueSlices(context, authoredSlice) {
|
|
|
164404
164949
|
if (cached !== void 0) return cached;
|
|
164405
164950
|
const expression = initializerExpressionSlice(authoredSlice);
|
|
164406
164951
|
if (expression === void 0) return [];
|
|
164407
|
-
const values = topLevelEntrySlices(expression, "(", ")").map(
|
|
164408
|
-
|
|
164409
|
-
|
|
164410
|
-
|
|
164411
|
-
|
|
164412
|
-
});
|
|
164952
|
+
const values = topLevelEntrySlices(expression, "(", ")").map(
|
|
164953
|
+
(entry) => normalizeInitializerSource(
|
|
164954
|
+
entry.replace(/^[A-Za-z_][A-Za-z0-9_]*\s*:\s*/, "")
|
|
164955
|
+
)
|
|
164956
|
+
);
|
|
164413
164957
|
context.syntax.arguments.set(authoredSlice, values);
|
|
164414
164958
|
return values;
|
|
164415
164959
|
}
|
|
@@ -166425,10 +166969,24 @@ function lowerAuthoredValueRow(context, member, sourceExpression, expectedValueI
|
|
|
166425
166969
|
);
|
|
166426
166970
|
const checksCanonicalConstruction = requiresCanonicalConstruction && !projectedConstructionEditable;
|
|
166427
166971
|
if (source.purpose === "stored" && storedConstructorArgs !== null || checksCanonicalConstruction) {
|
|
166972
|
+
const constructionCode = settleInitializerReferenceSpellings(
|
|
166973
|
+
context.localValues.executable(
|
|
166974
|
+
authoredConstruction2,
|
|
166975
|
+
bindingRuntimeIdentifiers(context, source)
|
|
166976
|
+
).code,
|
|
166977
|
+
(call, site) => settledReferenceTarget(context, call, site, {
|
|
166978
|
+
member: resolvedMember,
|
|
166979
|
+
valueId: expectedValueId,
|
|
166980
|
+
source,
|
|
166981
|
+
expression
|
|
166982
|
+
}),
|
|
166983
|
+
context.syntax
|
|
166984
|
+
).code;
|
|
166428
166985
|
const construction = {
|
|
166429
166986
|
valueId: expectedValueId,
|
|
166430
166987
|
code: compiledCode,
|
|
166431
166988
|
construction: authoredConstruction2,
|
|
166989
|
+
constructionCode,
|
|
166432
166990
|
site: initializerSite
|
|
166433
166991
|
};
|
|
166434
166992
|
context.initializerReconciliations.set(
|
|
@@ -167314,13 +167872,16 @@ function requiredConstructorProjectionMap(classes, constructors, members2, class
|
|
|
167314
167872
|
const required2 = requiredId === void 0 ? void 0 : constructors.get(requiredId);
|
|
167315
167873
|
if (schemaClass2 === void 0 || required2 === void 0) return /* @__PURE__ */ new Map();
|
|
167316
167874
|
const result = /* @__PURE__ */ new Map();
|
|
167875
|
+
const parameterNames = new Set(
|
|
167876
|
+
required2.arguments.map((parameter4) => parameter4.name)
|
|
167877
|
+
);
|
|
167317
167878
|
for (const memberId of Object.values(schemaClass2.schema)) {
|
|
167318
167879
|
const initializer = members2.get(memberId)?.defaultValue;
|
|
167319
167880
|
if (initializer === null || initializer === void 0 || !("init" in initializer)) {
|
|
167320
167881
|
continue;
|
|
167321
167882
|
}
|
|
167322
167883
|
const parameterName = initializer.init.code.trim();
|
|
167323
|
-
if (
|
|
167884
|
+
if (parameterNames.has(parameterName)) {
|
|
167324
167885
|
result.set(parameterName, memberId);
|
|
167325
167886
|
}
|
|
167326
167887
|
}
|
|
@@ -167335,7 +167896,7 @@ function requiredConstructorProjectionMap(classes, constructors, members2, class
|
|
|
167335
167896
|
);
|
|
167336
167897
|
for (const forwarded of required2.baseArguments ?? []) {
|
|
167337
167898
|
const sourceName = forwarded.code.trim();
|
|
167338
|
-
if (!
|
|
167899
|
+
if (!parameterNames.has(sourceName)) {
|
|
167339
167900
|
continue;
|
|
167340
167901
|
}
|
|
167341
167902
|
const memberId = base.get(forwarded.name);
|
|
@@ -167514,6 +168075,17 @@ function inferAnimationChildOverrideLowerEnvironment(context, schemaClass2, expr
|
|
|
167514
168075
|
return inherited;
|
|
167515
168076
|
}
|
|
167516
168077
|
const parameter4 = schemaClass2.genericParameters[0];
|
|
168078
|
+
const explicitType = expression.typeArguments?.[0];
|
|
168079
|
+
if (parameter4 !== void 0 && explicitType !== void 0) {
|
|
168080
|
+
const childClass = requiredClassByName(
|
|
168081
|
+
context,
|
|
168082
|
+
astTypeNameV4(explicitType)
|
|
168083
|
+
);
|
|
168084
|
+
return new Map(inherited).set(
|
|
168085
|
+
parameter4.id,
|
|
168086
|
+
inferredGenericClassBinding(childClass.id)
|
|
168087
|
+
);
|
|
168088
|
+
}
|
|
167517
168089
|
const parameterName = requiredConstructorFirstParameterName(
|
|
167518
168090
|
context,
|
|
167519
168091
|
schemaClass2
|
|
@@ -167569,8 +168141,8 @@ function animationChildOverrideSeedBindings(context, schemaClass2, environment,
|
|
|
167569
168141
|
);
|
|
167570
168142
|
}
|
|
167571
168143
|
const existingBinding = environmentBinding ? context.members.get(environmentBinding) : void 0;
|
|
167572
|
-
const reservedBindingMemberId = worldAnimationChildOverrideBindingMemberId(classId);
|
|
167573
|
-
const bindingMember = existingBinding?.kind === "class" && existingBinding.classId === classId ? existingBinding : context.members.get(reservedBindingMemberId);
|
|
168144
|
+
const reservedBindingMemberId = isPendingId(classId) ? pendingAnimationChildBindingMemberId(classId) : worldAnimationChildOverrideBindingMemberId(classId);
|
|
168145
|
+
const bindingMember = existingBinding?.kind === "class" && existingBinding.classId === classId && existingBinding.name === WORLD_ANIMATION_CHILD_OVERRIDE_BINDING_MEMBER_NAME ? existingBinding : context.members.get(reservedBindingMemberId);
|
|
167574
168146
|
if (bindingMember !== void 0) {
|
|
167575
168147
|
if (bindingMember.kind !== "class" || bindingMember.classId !== classId || bindingMember.name !== WORLD_ANIMATION_CHILD_OVERRIDE_BINDING_MEMBER_NAME) {
|
|
167576
168148
|
throw new Error(
|
|
@@ -169544,7 +170116,7 @@ function lowerDelegateValue(context, member, source, expression, authoredSlice)
|
|
|
169544
170116
|
const target = methodGroupTarget(
|
|
169545
170117
|
context,
|
|
169546
170118
|
expression,
|
|
169547
|
-
source.ownerClassId,
|
|
170119
|
+
source.variantTargetClassId !== void 0 && context.classesByName.get("NeoAnimationChildOverride")?.schema.Selector === member.id ? source.variantTargetClassId : source.ownerClassId,
|
|
169548
170120
|
member.arguments.map((argument2) => argument2.type)
|
|
169549
170121
|
);
|
|
169550
170122
|
if ("failure" in target) {
|
|
@@ -170145,6 +170717,7 @@ function classValueBody(context, member, value, visited, targetTyped, outerEnvir
|
|
|
170145
170717
|
context,
|
|
170146
170718
|
schemaClass2,
|
|
170147
170719
|
value,
|
|
170720
|
+
member,
|
|
170148
170721
|
name,
|
|
170149
170722
|
environment,
|
|
170150
170723
|
visited,
|
|
@@ -170166,6 +170739,7 @@ function classValueBody(context, member, value, visited, targetTyped, outerEnvir
|
|
|
170166
170739
|
context,
|
|
170167
170740
|
schemaClass2,
|
|
170168
170741
|
value,
|
|
170742
|
+
member,
|
|
170169
170743
|
name,
|
|
170170
170744
|
environment,
|
|
170171
170745
|
visited,
|
|
@@ -170247,7 +170821,7 @@ function classValueBody(context, member, value, visited, targetTyped, outerEnvir
|
|
|
170247
170821
|
context,
|
|
170248
170822
|
childMemberId,
|
|
170249
170823
|
projection.memberIds
|
|
170250
|
-
)) {
|
|
170824
|
+
) && context.localValues?.byValueId.has(childId) !== true) {
|
|
170251
170825
|
continue;
|
|
170252
170826
|
}
|
|
170253
170827
|
const childMember = context.members.get(childMemberId);
|
|
@@ -170344,7 +170918,20 @@ ${fields.map((field) => indentNeoSource(field, 2)).join(",\n")}
|
|
|
170344
170918
|
projection.arguments
|
|
170345
170919
|
) : targetTyped ? "new()" : `new ${name}()`;
|
|
170346
170920
|
if (typeof value.id === "string" && (storedConstruction !== null || projection.arguments.length > 0 || schemaClass2.requiredConstructorId !== void 0)) {
|
|
170347
|
-
|
|
170921
|
+
const usesLocalArguments = storedArgumentEntries.some(
|
|
170922
|
+
([, id2]) => context.localValues?.byValueId.has(id2)
|
|
170923
|
+
);
|
|
170924
|
+
const canonical = usesLocalArguments ? storedConstructorCallSource(
|
|
170925
|
+
{ ...context, localValues: void 0 },
|
|
170926
|
+
schemaClass2,
|
|
170927
|
+
value,
|
|
170928
|
+
member,
|
|
170929
|
+
name,
|
|
170930
|
+
environment,
|
|
170931
|
+
/* @__PURE__ */ new Set(),
|
|
170932
|
+
targetTyped
|
|
170933
|
+
) : null;
|
|
170934
|
+
context.materializedConstructors.set(value.id, canonical ?? constructor2);
|
|
170348
170935
|
}
|
|
170349
170936
|
if (typeof value.id === "string")
|
|
170350
170937
|
context.materializedConstructorOverrideKeys.set(value.id, overrideKeys);
|
|
@@ -170615,6 +171202,7 @@ function materializedValueSubgraphsEqual(context, currentGraph, replayGraph, cur
|
|
|
170615
171202
|
const typeInfo = resolveMemberDeclaredTypeInfo(
|
|
170616
171203
|
resolvedMember,
|
|
170617
171204
|
document.members,
|
|
171205
|
+
document.classes,
|
|
170618
171206
|
null,
|
|
170619
171207
|
genericEnv
|
|
170620
171208
|
);
|
|
@@ -170680,7 +171268,95 @@ function genericSlotIsRequired(context, member, environment) {
|
|
|
170680
171268
|
const binding = bindingId === void 0 ? void 0 : context.members.get(bindingId);
|
|
170681
171269
|
return binding === void 0 || isRequiredMember(binding);
|
|
170682
171270
|
}
|
|
170683
|
-
function
|
|
171271
|
+
function constructorArgumentGraph(context) {
|
|
171272
|
+
const cached = context.constructorArgumentGraph.value;
|
|
171273
|
+
if (cached !== void 0) return cached;
|
|
171274
|
+
const parents = /* @__PURE__ */ new Map();
|
|
171275
|
+
const graph = context.readMaterializedGraph();
|
|
171276
|
+
for (const [id2, placement] of context.storedPlacements.placementByChildValueId) {
|
|
171277
|
+
const parent = context.values.get(placement.parentValueId);
|
|
171278
|
+
let segment;
|
|
171279
|
+
if (typeof parent?.classId === "string")
|
|
171280
|
+
segment = `!.${placement.schemaKey}`;
|
|
171281
|
+
else {
|
|
171282
|
+
const owner = graph.ownerForValue(placement.parentValueId);
|
|
171283
|
+
const keyEnumId = owner !== void 0 && isMemberDictionaryBase(owner) ? owner.keyEnumId ?? null : null;
|
|
171284
|
+
segment = `![${emitDictionaryKey(placement.schemaKey, dictionaryOptions2(context, keyEnumId))}]`;
|
|
171285
|
+
}
|
|
171286
|
+
parents.set(id2, { parentId: placement.parentValueId, segment });
|
|
171287
|
+
}
|
|
171288
|
+
for (const [id2, row] of context.values) {
|
|
171289
|
+
const children4 = graph.childrenByContainerId.get(id2);
|
|
171290
|
+
if (!Array.isArray(row.value) && children4 === void 0) continue;
|
|
171291
|
+
if (graph.ownerForValue(id2)?.kind !== 6 /* List */) continue;
|
|
171292
|
+
const ids = Array.isArray(row.value) ? row.value : children4?.map((child2) => child2.id) ?? [];
|
|
171293
|
+
for (const [index, childId] of ids.entries())
|
|
171294
|
+
if (typeof childId === "string")
|
|
171295
|
+
parents.set(childId, { parentId: id2, segment: `![${index}]` });
|
|
171296
|
+
}
|
|
171297
|
+
const children3 = /* @__PURE__ */ new Map();
|
|
171298
|
+
for (const [id2, parent] of parents) {
|
|
171299
|
+
const siblings = children3.get(parent.parentId);
|
|
171300
|
+
if (siblings === void 0) children3.set(parent.parentId, [id2]);
|
|
171301
|
+
else siblings.push(id2);
|
|
171302
|
+
}
|
|
171303
|
+
const intervals = /* @__PURE__ */ new Map();
|
|
171304
|
+
let next = 0;
|
|
171305
|
+
const stack = [];
|
|
171306
|
+
for (const id2 of context.values.keys())
|
|
171307
|
+
if (!parents.has(id2)) stack.push({ id: id2, exit: false });
|
|
171308
|
+
while (stack.length > 0) {
|
|
171309
|
+
const frame = stack.pop();
|
|
171310
|
+
if (frame.exit) {
|
|
171311
|
+
intervals.get(frame.id).end = next;
|
|
171312
|
+
continue;
|
|
171313
|
+
}
|
|
171314
|
+
if (intervals.has(frame.id))
|
|
171315
|
+
throw new Error(
|
|
171316
|
+
`Constructor argument ownership cycle reaches ${frame.id}.`
|
|
171317
|
+
);
|
|
171318
|
+
intervals.set(frame.id, { start: next++, end: 0 });
|
|
171319
|
+
stack.push({ id: frame.id, exit: true });
|
|
171320
|
+
for (const child2 of children3.get(frame.id) ?? [])
|
|
171321
|
+
stack.push({ id: child2, exit: false });
|
|
171322
|
+
}
|
|
171323
|
+
return context.constructorArgumentGraph.value = { parents, intervals };
|
|
171324
|
+
}
|
|
171325
|
+
function constructorArgumentRelations(context, value, argumentIds) {
|
|
171326
|
+
const cached = context.constructorRelations.get(value);
|
|
171327
|
+
if (cached !== void 0) return cached;
|
|
171328
|
+
const graph = constructorArgumentGraph(context);
|
|
171329
|
+
const ordered = [...argumentIds].flatMap((id2) => {
|
|
171330
|
+
const interval = graph.intervals.get(id2);
|
|
171331
|
+
return interval === void 0 ? [] : [{ id: id2, ...interval }];
|
|
171332
|
+
}).sort((left, right) => left.start - right.start);
|
|
171333
|
+
const stack = [];
|
|
171334
|
+
const result = /* @__PURE__ */ new Map();
|
|
171335
|
+
for (const current of ordered) {
|
|
171336
|
+
while (stack.length > 0 && stack[stack.length - 1].end <= current.start)
|
|
171337
|
+
stack.pop();
|
|
171338
|
+
const parent = stack[stack.length - 1];
|
|
171339
|
+
if (parent !== void 0) result.set(current.id, { parentId: parent.id });
|
|
171340
|
+
stack.push(current);
|
|
171341
|
+
}
|
|
171342
|
+
context.constructorRelations.set(value, result);
|
|
171343
|
+
return result;
|
|
171344
|
+
}
|
|
171345
|
+
function concreteArgumentTypeName(context, type2, valueId, environment) {
|
|
171346
|
+
const row = context.values.get(valueId);
|
|
171347
|
+
if (typeof row?.classId !== "string")
|
|
171348
|
+
return storedSchemaTypeName(context, type2, environment, valueId);
|
|
171349
|
+
const settled = type2.kind === "generic" ? storedGenericArgumentType(context, type2, environment) : type2;
|
|
171350
|
+
if (settled.kind === "class" && settled.classId === row.classId)
|
|
171351
|
+
return storedSchemaTypeName(context, settled, environment, valueId);
|
|
171352
|
+
return classValueTypeName(
|
|
171353
|
+
context,
|
|
171354
|
+
row.classId,
|
|
171355
|
+
row,
|
|
171356
|
+
valueGenericEnvironment(row, environment)
|
|
171357
|
+
);
|
|
171358
|
+
}
|
|
171359
|
+
function storedConstructorCallSource(context, schemaClass2, value, member, className, environment, visited, targetTyped, cloneAggregateArguments = false, ownedArguments) {
|
|
170684
171360
|
const constructorArgs2 = value.constructorArgs;
|
|
170685
171361
|
if (!isObjectRecord(constructorArgs2)) return null;
|
|
170686
171362
|
const manifestClass = context.manifestClasses.get(
|
|
@@ -170711,7 +171387,103 @@ function storedConstructorCallSource(context, schemaClass2, value, className, en
|
|
|
170711
171387
|
manifestClass,
|
|
170712
171388
|
recordedConstructorId
|
|
170713
171389
|
);
|
|
170714
|
-
const
|
|
171390
|
+
const projectedMembers = requiredConstructorProjectionMap(
|
|
171391
|
+
context.manifestClasses,
|
|
171392
|
+
context.manifestConstructors,
|
|
171393
|
+
context.manifestMembers,
|
|
171394
|
+
stringField2(schemaClass2, "id"),
|
|
171395
|
+
/* @__PURE__ */ new Set()
|
|
171396
|
+
);
|
|
171397
|
+
const aggregateTypes = /* @__PURE__ */ new Map();
|
|
171398
|
+
for (const [index, argument2] of constructor2.arguments.entries()) {
|
|
171399
|
+
const id2 = constructorArgs2[`__arg_${index}__`];
|
|
171400
|
+
const type2 = argument2.type.kind === "generic" ? storedGenericArgumentType(context, argument2.type, environment) : argument2.type;
|
|
171401
|
+
if (typeof id2 === "string" && ["class", "interface", "list", "set", "dictionary"].includes(type2.kind))
|
|
171402
|
+
aggregateTypes.set(id2, type2);
|
|
171403
|
+
}
|
|
171404
|
+
const needsGraphReplay = aggregateTypes.size > 1 && [...aggregateTypes.keys()].some(
|
|
171405
|
+
(id2) => constructorArgumentBodySchemaKey(context, value, id2) !== void 0 || !isSharedConstructorArgument(context, id2, false)
|
|
171406
|
+
);
|
|
171407
|
+
const relations = needsGraphReplay ? constructorArgumentRelations(
|
|
171408
|
+
context,
|
|
171409
|
+
value,
|
|
171410
|
+
new Set(aggregateTypes.keys())
|
|
171411
|
+
) : /* @__PURE__ */ new Map();
|
|
171412
|
+
const relatedArguments = new Set(relations.keys());
|
|
171413
|
+
for (const relation of relations.values())
|
|
171414
|
+
relatedArguments.add(relation.parentId);
|
|
171415
|
+
const readOwnedArguments = () => {
|
|
171416
|
+
const valueId = stringField2(value, "id");
|
|
171417
|
+
const cached = context.constructorOwnedArguments.get(valueId);
|
|
171418
|
+
if (cached !== void 0) return cached;
|
|
171419
|
+
const code = storedConstructorCallSource(
|
|
171420
|
+
context,
|
|
171421
|
+
schemaClass2,
|
|
171422
|
+
value,
|
|
171423
|
+
member,
|
|
171424
|
+
className,
|
|
171425
|
+
environment,
|
|
171426
|
+
/* @__PURE__ */ new Set(),
|
|
171427
|
+
targetTyped,
|
|
171428
|
+
true,
|
|
171429
|
+
new Set(
|
|
171430
|
+
Object.values(constructorArgs2).filter(
|
|
171431
|
+
(argument2) => typeof argument2 === "string"
|
|
171432
|
+
)
|
|
171433
|
+
)
|
|
171434
|
+
);
|
|
171435
|
+
if (code === null)
|
|
171436
|
+
throw new Error(`Stored construction ${valueId} has no replay call.`);
|
|
171437
|
+
if (context.storedValueBase === void 0)
|
|
171438
|
+
context.constructorOwnershipReplayContext ??= context.readReplayContext();
|
|
171439
|
+
if (context.constructorOwnershipReplayContext === void 0) {
|
|
171440
|
+
const document = context.readDocument();
|
|
171441
|
+
let changed = false;
|
|
171442
|
+
const values = document.values.map((row) => {
|
|
171443
|
+
if (!isInitValueContent(row)) return row;
|
|
171444
|
+
const stored = context.storedValueBase?.get(row.id);
|
|
171445
|
+
if (!isMemberValue(stored) || !isLiteralValueContent(stored))
|
|
171446
|
+
return row;
|
|
171447
|
+
changed = true;
|
|
171448
|
+
return stored;
|
|
171449
|
+
});
|
|
171450
|
+
context.constructorOwnershipReplayContext = changed ? createPulledConstructionReplayContext({
|
|
171451
|
+
document: { ...document, values }
|
|
171452
|
+
}) : context.readReplayContext();
|
|
171453
|
+
}
|
|
171454
|
+
const replayContext = context.constructorOwnershipReplayContext;
|
|
171455
|
+
const rows = replayStoredConstructionV4({
|
|
171456
|
+
records: context.records,
|
|
171457
|
+
document: replayContext.document,
|
|
171458
|
+
valueId,
|
|
171459
|
+
code,
|
|
171460
|
+
member: concreteClassMemberForReplay(context, member, environment),
|
|
171461
|
+
compilationProject: context.readCompilationProject(),
|
|
171462
|
+
replayContext
|
|
171463
|
+
});
|
|
171464
|
+
const root = rows.get(valueId);
|
|
171465
|
+
const bodyIds = new Set(
|
|
171466
|
+
isObjectRecord(root?.value) ? Object.values(root.value) : []
|
|
171467
|
+
);
|
|
171468
|
+
const replayArguments2 = isObjectRecord(root?.constructorArgs) ? root.constructorArgs : {};
|
|
171469
|
+
const owned = /* @__PURE__ */ new Set();
|
|
171470
|
+
for (const [key, argument2] of Object.entries(constructorArgs2)) {
|
|
171471
|
+
if (typeof argument2 === "string" && bodyIds.has(replayArguments2[key]))
|
|
171472
|
+
owned.add(argument2);
|
|
171473
|
+
}
|
|
171474
|
+
context.constructorOwnedArguments.set(valueId, owned);
|
|
171475
|
+
const allBodyArgumentsOwned = Object.values(constructorArgs2).every(
|
|
171476
|
+
(argument2) => constructorArgumentBodySchemaKey(context, value, argument2) === void 0 || typeof argument2 === "string" && owned.has(argument2)
|
|
171477
|
+
);
|
|
171478
|
+
if (allBodyArgumentsOwned && replayContext.document === context.readDocument())
|
|
171479
|
+
context.constructionReplays.set(valueId, rows);
|
|
171480
|
+
return owned;
|
|
171481
|
+
};
|
|
171482
|
+
const argumentUses = /* @__PURE__ */ new Map();
|
|
171483
|
+
for (const argument2 of Object.values(constructorArgs2))
|
|
171484
|
+
if (typeof argument2 === "string")
|
|
171485
|
+
argumentUses.set(argument2, (argumentUses.get(argument2) ?? 0) + 1);
|
|
171486
|
+
const preparedArguments = constructor2.arguments.flatMap((argument2, index) => {
|
|
170715
171487
|
const key = `__arg_${index}__`;
|
|
170716
171488
|
if (!(key in constructorArgs2)) {
|
|
170717
171489
|
if (argument2.default !== null || argument2.type.nullable) return [];
|
|
@@ -170724,42 +171496,132 @@ function storedConstructorCallSource(context, schemaClass2, value, className, en
|
|
|
170724
171496
|
schemaClass2,
|
|
170725
171497
|
value,
|
|
170726
171498
|
constructorArgs2[key],
|
|
170727
|
-
argument2.name
|
|
171499
|
+
argument2.name,
|
|
171500
|
+
projectedMembers
|
|
170728
171501
|
);
|
|
170729
|
-
|
|
170730
|
-
|
|
171502
|
+
const bodySchemaKey = constructorArgumentBodySchemaKey(
|
|
171503
|
+
context,
|
|
171504
|
+
value,
|
|
171505
|
+
constructorArgs2[key]
|
|
171506
|
+
);
|
|
171507
|
+
let constructorOwnsGraph = bodySchemaKey !== void 0;
|
|
171508
|
+
const argumentValue = constructorArgs2[key];
|
|
171509
|
+
if (constructorOwnsGraph && typeof argumentValue === "string") {
|
|
171510
|
+
if (ownedArguments !== void 0)
|
|
171511
|
+
constructorOwnsGraph = ownedArguments.has(argumentValue);
|
|
171512
|
+
else if (projectedMembers.has(argument2.name) && argumentUses.get(argumentValue) === 1 && !relatedArguments.has(argumentValue))
|
|
171513
|
+
constructorOwnsGraph = settledMember?.kind !== 9 /* Lookup */;
|
|
171514
|
+
else constructorOwnsGraph = readOwnedArguments().has(argumentValue);
|
|
171515
|
+
}
|
|
171516
|
+
return [{ argument: argument2, argumentValue, settledMember, constructorOwnsGraph }];
|
|
171517
|
+
});
|
|
171518
|
+
const replayArguments = new Map(
|
|
171519
|
+
preparedArguments.flatMap(
|
|
171520
|
+
(entry) => typeof entry.argumentValue === "string" && aggregateTypes.has(entry.argumentValue) ? [[entry.argumentValue, entry]] : []
|
|
171521
|
+
)
|
|
171522
|
+
);
|
|
171523
|
+
const ownedReplayArguments = new Set(
|
|
171524
|
+
preparedArguments.flatMap(
|
|
171525
|
+
(entry) => entry.constructorOwnsGraph && typeof entry.argumentValue === "string" ? [entry.argumentValue] : []
|
|
171526
|
+
)
|
|
171527
|
+
);
|
|
171528
|
+
const bindings = /* @__PURE__ */ new Map();
|
|
171529
|
+
const declarations = [];
|
|
171530
|
+
const bindArgument = (id2) => {
|
|
171531
|
+
const bound = bindings.get(id2);
|
|
171532
|
+
if (bound !== void 0) return bound;
|
|
171533
|
+
const entry = replayArguments.get(id2);
|
|
171534
|
+
if (entry === void 0)
|
|
171535
|
+
throw new Error(
|
|
171536
|
+
`Constructor replay argument ${id2} has no typed parameter.`
|
|
171537
|
+
);
|
|
171538
|
+
const relation = relations.get(id2);
|
|
171539
|
+
const parent = relation === void 0 ? void 0 : bindArgument(relation.parentId);
|
|
171540
|
+
const name = `__neo_argument_${bindings.size}`;
|
|
171541
|
+
const typeName = concreteArgumentTypeName(
|
|
171542
|
+
context,
|
|
171543
|
+
entry.argument.type,
|
|
171544
|
+
id2,
|
|
171545
|
+
environment
|
|
171546
|
+
);
|
|
171547
|
+
if (relation !== void 0 && parent !== void 0) {
|
|
171548
|
+
const graph = constructorArgumentGraph(context);
|
|
171549
|
+
const path = [];
|
|
171550
|
+
let cursor = id2;
|
|
171551
|
+
while (!bindings.has(cursor)) {
|
|
171552
|
+
const edge = graph.parents.get(cursor);
|
|
171553
|
+
if (edge === void 0)
|
|
171554
|
+
throw new Error(
|
|
171555
|
+
`Constructor argument ${cursor} has no owning path to ${relation.parentId}.`
|
|
171556
|
+
);
|
|
171557
|
+
path.push({ id: cursor, segment: edge.segment });
|
|
171558
|
+
cursor = edge.parentId;
|
|
171559
|
+
}
|
|
171560
|
+
let receiver = bindings.get(cursor);
|
|
171561
|
+
for (const step of path.reverse()) {
|
|
171562
|
+
const stepName = `__neo_argument_${bindings.size}`;
|
|
171563
|
+
const source = `${receiver}${step.segment}`;
|
|
171564
|
+
const row = context.values.get(step.id);
|
|
171565
|
+
if (typeof row?.classId === "string") {
|
|
171566
|
+
const concreteType = step.id === id2 ? typeName : classValueTypeName(
|
|
171567
|
+
context,
|
|
171568
|
+
row.classId,
|
|
171569
|
+
row,
|
|
171570
|
+
valueGenericEnvironment(row, environment)
|
|
171571
|
+
);
|
|
171572
|
+
declarations.push(
|
|
171573
|
+
`if (${source} is not ${concreteType} ${stepName}) throw ${quote3(`Constructor argument path ${step.id} no longer has type ${concreteType}.`)};`
|
|
171574
|
+
);
|
|
171575
|
+
} else declarations.push(`var ${stepName} = ${source}!;`);
|
|
171576
|
+
bindings.set(step.id, stepName);
|
|
171577
|
+
receiver = stepName;
|
|
171578
|
+
}
|
|
171579
|
+
return receiver;
|
|
171580
|
+
} else {
|
|
171581
|
+
const owns = ownedArguments?.has(id2) ?? ownedReplayArguments.has(id2);
|
|
171582
|
+
const source = storedConstructorArgumentSource(
|
|
170731
171583
|
context,
|
|
170732
|
-
|
|
170733
|
-
|
|
171584
|
+
entry.argument.type,
|
|
171585
|
+
id2,
|
|
170734
171586
|
environment,
|
|
170735
171587
|
visited,
|
|
170736
|
-
|
|
170737
|
-
settledMember?.payload === 1 /* Partial */,
|
|
170738
|
-
|
|
170739
|
-
|
|
170740
|
-
|
|
170741
|
-
|
|
170742
|
-
|
|
170743
|
-
|
|
170744
|
-
|
|
170745
|
-
|
|
170746
|
-
|
|
170747
|
-
|
|
170748
|
-
|
|
170749
|
-
|
|
170750
|
-
|
|
170751
|
-
|
|
170752
|
-
|
|
170753
|
-
|
|
171588
|
+
true,
|
|
171589
|
+
entry.settledMember?.payload === 1 /* Partial */,
|
|
171590
|
+
owns
|
|
171591
|
+
);
|
|
171592
|
+
declarations.push(`${typeName} ${name} = ${source};`);
|
|
171593
|
+
}
|
|
171594
|
+
bindings.set(id2, name);
|
|
171595
|
+
return name;
|
|
171596
|
+
};
|
|
171597
|
+
const argumentsValue = preparedArguments.map((entry) => {
|
|
171598
|
+
const { argument: argument2, argumentValue, settledMember, constructorOwnsGraph } = entry;
|
|
171599
|
+
if (cloneAggregateArguments && typeof argumentValue === "string" && aggregateTypes.has(argumentValue) && ((argumentUses.get(argumentValue) ?? 0) > 1 || relatedArguments.has(argumentValue)))
|
|
171600
|
+
return `${argument2.name}: ${bindArgument(argumentValue)}`;
|
|
171601
|
+
return `${argument2.name}: ${storedConstructorArgumentSource(
|
|
171602
|
+
context,
|
|
171603
|
+
argument2.type,
|
|
171604
|
+
argumentValue,
|
|
171605
|
+
environment,
|
|
171606
|
+
visited,
|
|
171607
|
+
cloneAggregateArguments,
|
|
171608
|
+
settledMember?.payload === 1 /* Partial */,
|
|
171609
|
+
constructorOwnsGraph
|
|
171610
|
+
)}`;
|
|
170754
171611
|
});
|
|
170755
|
-
|
|
171612
|
+
const call = constructorCallSource(
|
|
170756
171613
|
targetTyped ? "new" : `new ${className}`,
|
|
170757
171614
|
argumentsValue
|
|
170758
171615
|
);
|
|
171616
|
+
return declarations.length === 0 ? call : `(() => { ${declarations.join(" ")} return ${call}; })()`;
|
|
170759
171617
|
}
|
|
170760
|
-
function settledMemberForConstructorArgument(context, schemaClass2, value, argument2, argumentName) {
|
|
171618
|
+
function settledMemberForConstructorArgument(context, schemaClass2, value, argument2, argumentName, projectedMembers) {
|
|
170761
171619
|
if (typeof argument2 !== "string") return void 0;
|
|
170762
171620
|
const schema = isObjectRecord(schemaClass2.schema) ? schemaClass2.schema : {};
|
|
171621
|
+
const projectedMemberId = projectedMembers.get(argumentName);
|
|
171622
|
+
if (projectedMemberId !== void 0) {
|
|
171623
|
+
return context.members.get(projectedMemberId);
|
|
171624
|
+
}
|
|
170763
171625
|
const bodySchemaKey = constructorArgumentBodySchemaKey(
|
|
170764
171626
|
context,
|
|
170765
171627
|
value,
|
|
@@ -170768,16 +171630,6 @@ function settledMemberForConstructorArgument(context, schemaClass2, value, argum
|
|
|
170768
171630
|
if (bodySchemaKey !== void 0) {
|
|
170769
171631
|
return memberForSchemaKey(context, schema, bodySchemaKey);
|
|
170770
171632
|
}
|
|
170771
|
-
const projectedMemberId = requiredConstructorProjectionMap(
|
|
170772
|
-
context.manifestClasses,
|
|
170773
|
-
context.manifestConstructors,
|
|
170774
|
-
context.manifestMembers,
|
|
170775
|
-
stringField2(schemaClass2, "id"),
|
|
170776
|
-
/* @__PURE__ */ new Set()
|
|
170777
|
-
).get(argumentName);
|
|
170778
|
-
if (projectedMemberId !== void 0) {
|
|
170779
|
-
return context.members.get(projectedMemberId);
|
|
170780
|
-
}
|
|
170781
171633
|
const namedSchemaKey = schemaKeyForParameterName(schema, argumentName);
|
|
170782
171634
|
return namedSchemaKey === void 0 ? void 0 : memberForSchemaKey(context, schema, namedSchemaKey);
|
|
170783
171635
|
}
|
|
@@ -171280,7 +172132,12 @@ function storedAggregateReplaySource(context, type2, valueId, environment, const
|
|
|
171280
172132
|
`Stored ${type2.kind} constructor argument references missing value row ${valueId}.`
|
|
171281
172133
|
);
|
|
171282
172134
|
}
|
|
171283
|
-
const typeName =
|
|
172135
|
+
const typeName = concreteArgumentTypeName(
|
|
172136
|
+
context,
|
|
172137
|
+
type2,
|
|
172138
|
+
valueId,
|
|
172139
|
+
environment
|
|
172140
|
+
);
|
|
171284
172141
|
const reference2 = `Reference<${typeName}>(id: ${quote3(valueId)})`;
|
|
171285
172142
|
return isSharedConstructorArgument(context, valueId, constructorOwnsGraph) ? reference2 : `${reference2}.Clone()`;
|
|
171286
172143
|
}
|
|
@@ -171451,8 +172308,10 @@ function storedTypedRowSource(context, type2, valueId, environment, visited, wri
|
|
|
171451
172308
|
);
|
|
171452
172309
|
}
|
|
171453
172310
|
}
|
|
171454
|
-
if (isSharedConstructorArgument(context, valueId, constructorOwnsGraph)) {
|
|
171455
|
-
|
|
172311
|
+
if (context.localValues?.byValueId.has(valueId) || isSharedConstructorArgument(context, valueId, constructorOwnsGraph)) {
|
|
172312
|
+
const local = context.localValues?.byValueId.get(valueId);
|
|
172313
|
+
const target = local === void 0 ? `id: ${quote3(valueId)}` : local.name;
|
|
172314
|
+
return `Reference<${storedSchemaTypeName(context, type2, environment, valueId)}>(${target})`;
|
|
171456
172315
|
}
|
|
171457
172316
|
if (context.activeStoredConstructorArguments.has(valueId)) {
|
|
171458
172317
|
throw new Error(
|
|
@@ -172016,7 +172875,7 @@ function referenceValue(context, member, body, dialogue, slotTypeName = null) {
|
|
|
172016
172875
|
return `Reference<${dialogueSymbol}>(${dialogueSymbol})`;
|
|
172017
172876
|
}
|
|
172018
172877
|
}
|
|
172019
|
-
const symbol = context.localValues?.byValueId.get(id2)?.name ?? context.symbolsByValueId.get(id2);
|
|
172878
|
+
const symbol = (context.values.has(id2) ? context.localValues?.byValueId.get(id2)?.name : void 0) ?? context.symbolsByValueId.get(id2);
|
|
172020
172879
|
if (symbol !== void 0) return `Reference(${symbol})`;
|
|
172021
172880
|
if (slotTypeName !== null) {
|
|
172022
172881
|
const path = slotRootPath(context, id2);
|
|
@@ -172576,6 +173435,7 @@ var INFERRED_GENERIC_CLASS_PREFIX, MEMBER_KIND_DICTIONARY2, MEMBER_KIND_LIST2, M
|
|
|
172576
173435
|
var init_value_sources = __esm({
|
|
172577
173436
|
"src/project-source/value-sources.ts"() {
|
|
172578
173437
|
"use strict";
|
|
173438
|
+
init_animation_child_binding_id();
|
|
172579
173439
|
init_source_diagnostics();
|
|
172580
173440
|
init_immutable_json3();
|
|
172581
173441
|
init_lower_support();
|
|
@@ -173290,7 +174150,9 @@ function buildNeoScriptProject(document) {
|
|
|
173290
174150
|
classes: document.classes,
|
|
173291
174151
|
enums: document.enums,
|
|
173292
174152
|
interfaces: document.interfaces,
|
|
173293
|
-
constructors: document.constructors ?? []
|
|
174153
|
+
constructors: document.constructors ?? [],
|
|
174154
|
+
variants: document.variants,
|
|
174155
|
+
variantFolders: document.variantFolders
|
|
173294
174156
|
});
|
|
173295
174157
|
}
|
|
173296
174158
|
function neoScriptProjectFingerprint(document) {
|
|
@@ -173506,9 +174368,7 @@ function reconcileMaterializedInitializersV4(args) {
|
|
|
173506
174368
|
member: owner,
|
|
173507
174369
|
compilationProject: project
|
|
173508
174370
|
});
|
|
173509
|
-
const authored = compiled(
|
|
173510
|
-
constructorExpressionSlice(reconciliation.code)
|
|
173511
|
-
);
|
|
174371
|
+
const authored = compiled(reconciliation.constructionCode);
|
|
173512
174372
|
if (authored === null || !sameCompiledProgram(authored, compiled(canonicalExpression))) {
|
|
173513
174373
|
replayableValueIds.add(valueId);
|
|
173514
174374
|
}
|
|
@@ -173940,6 +174800,13 @@ function materializeInitializersLocallyV4(args) {
|
|
|
173940
174800
|
},
|
|
173941
174801
|
valueIds: compiledBodyIds
|
|
173942
174802
|
});
|
|
174803
|
+
const failures = [];
|
|
174804
|
+
const unavailableRootIds = /* @__PURE__ */ new Set();
|
|
174805
|
+
const onFailure = args.collectErrors === true ? (ids, error) => {
|
|
174806
|
+
const dependent = error instanceof PendingInitializerDependency && unavailableRootIds.has(error.valueId);
|
|
174807
|
+
for (const id2 of ids) unavailableRootIds.add(id2);
|
|
174808
|
+
if (!dependent) failures.push(error);
|
|
174809
|
+
} : void 0;
|
|
173943
174810
|
const compiledInitializers = /* @__PURE__ */ new Map();
|
|
173944
174811
|
const templateContext = createPulledConstructionReplayContext({
|
|
173945
174812
|
document: authoredDocument,
|
|
@@ -173952,19 +174819,25 @@ function materializeInitializersLocallyV4(args) {
|
|
|
173952
174819
|
walkedRootOwners,
|
|
173953
174820
|
batch.valuesById
|
|
173954
174821
|
);
|
|
173955
|
-
|
|
173956
|
-
|
|
173957
|
-
|
|
173958
|
-
|
|
173959
|
-
|
|
173960
|
-
|
|
173961
|
-
|
|
173962
|
-
|
|
173963
|
-
|
|
173964
|
-
|
|
173965
|
-
|
|
173966
|
-
|
|
173967
|
-
|
|
174822
|
+
try {
|
|
174823
|
+
replayStoredConstructionV4({
|
|
174824
|
+
records: records3,
|
|
174825
|
+
document: authoredDocument,
|
|
174826
|
+
valueId: id2,
|
|
174827
|
+
code: initializerCode(records3, id2),
|
|
174828
|
+
compilationProject,
|
|
174829
|
+
replayContext: templateContext,
|
|
174830
|
+
member: rootOwners.get(id2),
|
|
174831
|
+
initializerOwnerClass: ownerContext.declaringClass,
|
|
174832
|
+
lexicalThisClass: ownerContext.lexicalThisClass,
|
|
174833
|
+
evaluate: false,
|
|
174834
|
+
onCompiledInitializer: (init) => compiledInitializers.set(id2, init)
|
|
174835
|
+
});
|
|
174836
|
+
} catch (error) {
|
|
174837
|
+
if (onFailure === void 0) throw error;
|
|
174838
|
+
onFailure([id2], error);
|
|
174839
|
+
pendingRoots.delete(id2);
|
|
174840
|
+
}
|
|
173968
174841
|
}
|
|
173969
174842
|
const typeMembers = compiledConstructionTypeMembers(
|
|
173970
174843
|
authoredDocument.members,
|
|
@@ -173979,135 +174852,169 @@ function materializeInitializersLocallyV4(args) {
|
|
|
173979
174852
|
batch = createInitializerMaterializationBatch(replayDocument, pendingRoots);
|
|
173980
174853
|
}
|
|
173981
174854
|
batch.upsert(compiledClosures);
|
|
173982
|
-
|
|
173983
|
-
|
|
173984
|
-
|
|
173985
|
-
|
|
173986
|
-
|
|
173987
|
-
|
|
173988
|
-
|
|
173989
|
-
|
|
173990
|
-
|
|
173991
|
-
|
|
173992
|
-
|
|
173993
|
-
|
|
173994
|
-
|
|
173995
|
-
|
|
173996
|
-
|
|
173997
|
-
|
|
173998
|
-
|
|
173999
|
-
|
|
174000
|
-
|
|
174001
|
-
|
|
174002
|
-
|
|
174003
|
-
|
|
174004
|
-
|
|
174005
|
-
|
|
174006
|
-
|
|
174007
|
-
|
|
174008
|
-
|
|
174009
|
-
|
|
174010
|
-
|
|
174011
|
-
|
|
174012
|
-
|
|
174013
|
-
compiledInitializer: compiledInitializers.get(sourceValueId),
|
|
174014
|
-
onCompiledInitializer: (init) => {
|
|
174015
|
-
compiledInitializer = init;
|
|
174016
|
-
compiledInitializers.set(sourceValueId, init);
|
|
174017
|
-
},
|
|
174018
|
-
onConstructionPreservation: (keys) => {
|
|
174019
|
-
pinned = keys;
|
|
174855
|
+
const resolvedLocalIds = /* @__PURE__ */ new Map();
|
|
174856
|
+
materializeInitializerDependencies(
|
|
174857
|
+
pendingRoots,
|
|
174858
|
+
(sourceValueId) => {
|
|
174859
|
+
const batchDocument = batch.document();
|
|
174860
|
+
const database = batchDocument.databaseVM;
|
|
174861
|
+
if (database !== void 0) {
|
|
174862
|
+
batchDocument.databaseVM = {
|
|
174863
|
+
...database,
|
|
174864
|
+
valueById: (id2) => {
|
|
174865
|
+
if (unavailableRootIds.has(id2))
|
|
174866
|
+
throw new PendingInitializerDependency(id2);
|
|
174867
|
+
const location3 = args.localReferenceLocations?.get(id2);
|
|
174868
|
+
if (location3 === void 0) return database.valueById(id2);
|
|
174869
|
+
if (unavailableRootIds.has(location3.rootId))
|
|
174870
|
+
throw new PendingInitializerDependency(location3.rootId);
|
|
174871
|
+
if (pendingRoots.has(location3.rootId))
|
|
174872
|
+
throw new PendingInitializerDependency(location3.rootId);
|
|
174873
|
+
const target = resolvedLocalIds.get(id2) ?? storedValueAtPathV4(
|
|
174874
|
+
batch.valuesById,
|
|
174875
|
+
location3.rootId,
|
|
174876
|
+
location3.path
|
|
174877
|
+
);
|
|
174878
|
+
if (target === null)
|
|
174879
|
+
throw new Error(
|
|
174880
|
+
`Local value ${id2} has no row at its owning path.`
|
|
174881
|
+
);
|
|
174882
|
+
resolvedLocalIds.set(id2, target);
|
|
174883
|
+
return database.valueById(target);
|
|
174884
|
+
}
|
|
174885
|
+
};
|
|
174020
174886
|
}
|
|
174021
|
-
|
|
174022
|
-
|
|
174023
|
-
|
|
174024
|
-
|
|
174025
|
-
|
|
174026
|
-
);
|
|
174027
|
-
|
|
174028
|
-
if (compiledInitializer === void 0) {
|
|
174029
|
-
throw new Error(
|
|
174030
|
-
`CLI initializer materialization did not compile root "${sourceValueId}".`
|
|
174031
|
-
);
|
|
174032
|
-
}
|
|
174033
|
-
const evaluatedChildren = [...evaluated.entries()].flatMap(([id2, row]) => {
|
|
174034
|
-
if (id2 === sourceValueId) return [];
|
|
174035
|
-
if (!isMemberValue(row)) {
|
|
174887
|
+
const document = {
|
|
174888
|
+
...replayDocument,
|
|
174889
|
+
values: batchDocument.values,
|
|
174890
|
+
databaseVM: batchDocument.databaseVM
|
|
174891
|
+
};
|
|
174892
|
+
const rootOwner = rootOwners.get(sourceValueId);
|
|
174893
|
+
if (rootOwner === void 0) {
|
|
174036
174894
|
throw new Error(
|
|
174037
|
-
`CLI initializer materialization for "${sourceValueId}"
|
|
174895
|
+
`CLI initializer materialization cannot resolve the owning member for root "${sourceValueId}".`
|
|
174038
174896
|
);
|
|
174039
174897
|
}
|
|
174040
|
-
|
|
174041
|
-
|
|
174042
|
-
|
|
174043
|
-
|
|
174044
|
-
|
|
174045
|
-
|
|
174046
|
-
|
|
174047
|
-
|
|
174048
|
-
|
|
174049
|
-
|
|
174050
|
-
|
|
174051
|
-
|
|
174052
|
-
|
|
174053
|
-
|
|
174054
|
-
|
|
174055
|
-
|
|
174056
|
-
|
|
174898
|
+
const replayContext = createPulledConstructionReplayContext({
|
|
174899
|
+
document,
|
|
174900
|
+
valuesById: batch.valuesById
|
|
174901
|
+
});
|
|
174902
|
+
const code = initializerCode(records3, sourceValueId);
|
|
174903
|
+
let compiledInitializer;
|
|
174904
|
+
let pinned = {
|
|
174905
|
+
pinnedRootSchemaKeys: /* @__PURE__ */ new Set(),
|
|
174906
|
+
pinnedSchemaKeysByValueId: /* @__PURE__ */ new Map()
|
|
174907
|
+
};
|
|
174908
|
+
const evaluated = replayStoredConstructionV4({
|
|
174909
|
+
records: records3,
|
|
174910
|
+
document,
|
|
174911
|
+
valueId: sourceValueId,
|
|
174912
|
+
code,
|
|
174913
|
+
compilationProject,
|
|
174914
|
+
replayContext,
|
|
174915
|
+
member: rootOwner,
|
|
174916
|
+
compiledInitializer: compiledInitializers.get(sourceValueId),
|
|
174917
|
+
onCompiledInitializer: (init) => {
|
|
174918
|
+
compiledInitializer = init;
|
|
174919
|
+
compiledInitializers.set(sourceValueId, init);
|
|
174920
|
+
},
|
|
174921
|
+
onConstructionPreservation: (keys) => {
|
|
174922
|
+
pinned = keys;
|
|
174923
|
+
}
|
|
174924
|
+
});
|
|
174925
|
+
const evaluatedRoot = evaluated.get(sourceValueId);
|
|
174926
|
+
if (evaluatedRoot === void 0 || !isMemberValue(evaluatedRoot)) {
|
|
174927
|
+
throw new Error(
|
|
174928
|
+
`CLI initializer materialization produced no root row for value "${sourceValueId}".`
|
|
174929
|
+
);
|
|
174930
|
+
}
|
|
174931
|
+
if (compiledInitializer === void 0) {
|
|
174932
|
+
throw new Error(
|
|
174933
|
+
`CLI initializer materialization did not compile root "${sourceValueId}".`
|
|
174934
|
+
);
|
|
174935
|
+
}
|
|
174936
|
+
const evaluatedChildren = [...evaluated.entries()].flatMap(
|
|
174937
|
+
([id2, row]) => {
|
|
174938
|
+
if (id2 === sourceValueId) return [];
|
|
174939
|
+
if (!isMemberValue(row)) {
|
|
174940
|
+
throw new Error(
|
|
174941
|
+
`CLI initializer materialization for "${sourceValueId}" produced an invalid value row.`
|
|
174942
|
+
);
|
|
174943
|
+
}
|
|
174944
|
+
return [row];
|
|
174945
|
+
}
|
|
174057
174946
|
);
|
|
174058
|
-
|
|
174059
|
-
|
|
174060
|
-
|
|
174061
|
-
|
|
174947
|
+
const baseline = replayStoredConstructionV4({
|
|
174948
|
+
records: records3,
|
|
174949
|
+
document,
|
|
174950
|
+
valueId: sourceValueId,
|
|
174951
|
+
code,
|
|
174952
|
+
compilationProject,
|
|
174953
|
+
replayContext,
|
|
174954
|
+
member: rootOwner,
|
|
174955
|
+
compiledInitializer,
|
|
174956
|
+
omitConstructionFields: true
|
|
174957
|
+
});
|
|
174958
|
+
const baselineRoot = baseline.get(sourceValueId);
|
|
174959
|
+
if (baselineRoot === void 0 || !isMemberValue(baselineRoot)) {
|
|
174062
174960
|
throw new Error(
|
|
174063
|
-
`CLI initializer baseline for "${sourceValueId}"
|
|
174961
|
+
`CLI initializer baseline produced no root row for value "${sourceValueId}".`
|
|
174064
174962
|
);
|
|
174065
174963
|
}
|
|
174066
|
-
|
|
174067
|
-
|
|
174068
|
-
|
|
174069
|
-
|
|
174070
|
-
|
|
174071
|
-
|
|
174072
|
-
|
|
174073
|
-
|
|
174074
|
-
createdChildren: evaluatedChildren
|
|
174075
|
-
},
|
|
174076
|
-
baseline: {
|
|
174077
|
-
root: baselineRoot,
|
|
174078
|
-
createdChildren: baselineChildren
|
|
174079
|
-
},
|
|
174080
|
-
// §4: a call-site field is an explicit override even when it equals the
|
|
174081
|
-
// class default, so the evaluated construction's own field list is what
|
|
174082
|
-
// pins rows against collapse. Push preparation pins the same set.
|
|
174083
|
-
snapshot: pinned.snapshot,
|
|
174084
|
-
pinnedRootSchemaKeys: pinned.pinnedRootSchemaKeys,
|
|
174085
|
-
pinnedSchemaKeysByValueId: pinned.pinnedSchemaKeysByValueId,
|
|
174086
|
-
bindingTargets,
|
|
174087
|
-
virtualValueIdForSource: (instanceRootId, sourceIdentity3) => isPendingId(instanceRootId) || hasPendingVirtualSourceIdentity(sourceIdentity3) ? pendingVirtualValueId(instanceRootId, sourceIdentity3) : virtualValueId(instanceRootId, sourceIdentity3)
|
|
174088
|
-
});
|
|
174089
|
-
const evaluatedRows = [sparse2.root, ...sparse2.createdChildren];
|
|
174090
|
-
assertStoredClosuresKeepNoCaptures({
|
|
174091
|
-
sourceValueId,
|
|
174092
|
-
rows: evaluatedRows,
|
|
174093
|
-
constructors: document.constructors ?? []
|
|
174094
|
-
});
|
|
174095
|
-
roots.push({
|
|
174096
|
-
sourceValueId,
|
|
174097
|
-
rows: evaluatedRows.map((row) => ({ ...row }))
|
|
174098
|
-
});
|
|
174099
|
-
for (const row of evaluatedRows) {
|
|
174100
|
-
records3.set(`value:${row.id}`, {
|
|
174101
|
-
recordKind: "value",
|
|
174102
|
-
recordId: row.id,
|
|
174103
|
-
contentHash: "local-materialization",
|
|
174104
|
-
deleted: false,
|
|
174105
|
-
data: row
|
|
174964
|
+
const baselineChildren = [...baseline.entries()].flatMap(([id2, row]) => {
|
|
174965
|
+
if (id2 === sourceValueId) return [];
|
|
174966
|
+
if (!isMemberValue(row)) {
|
|
174967
|
+
throw new Error(
|
|
174968
|
+
`CLI initializer baseline for "${sourceValueId}" produced an invalid value row.`
|
|
174969
|
+
);
|
|
174970
|
+
}
|
|
174971
|
+
return [row];
|
|
174106
174972
|
});
|
|
174107
|
-
|
|
174108
|
-
|
|
174109
|
-
|
|
174110
|
-
|
|
174973
|
+
const sparse2 = sparsifyConstructedInstance({
|
|
174974
|
+
localizedTextIds,
|
|
174975
|
+
document,
|
|
174976
|
+
rootMember: rootOwner,
|
|
174977
|
+
constructed: {
|
|
174978
|
+
root: evaluatedRoot,
|
|
174979
|
+
createdChildren: evaluatedChildren
|
|
174980
|
+
},
|
|
174981
|
+
baseline: {
|
|
174982
|
+
root: baselineRoot,
|
|
174983
|
+
createdChildren: baselineChildren
|
|
174984
|
+
},
|
|
174985
|
+
// §4: a call-site field is an explicit override even when it equals the
|
|
174986
|
+
// class default, so the evaluated construction's own field list is what
|
|
174987
|
+
// pins rows against collapse. Push preparation pins the same set.
|
|
174988
|
+
snapshot: pinned.snapshot,
|
|
174989
|
+
pinnedRootSchemaKeys: pinned.pinnedRootSchemaKeys,
|
|
174990
|
+
pinnedSchemaKeysByValueId: pinned.pinnedSchemaKeysByValueId,
|
|
174991
|
+
bindingTargets,
|
|
174992
|
+
virtualValueIdForSource: (instanceRootId, sourceIdentity3) => isPendingId(instanceRootId) || hasPendingVirtualSourceIdentity(sourceIdentity3) ? pendingVirtualValueId(instanceRootId, sourceIdentity3) : virtualValueId(instanceRootId, sourceIdentity3)
|
|
174993
|
+
});
|
|
174994
|
+
const evaluatedRows = [sparse2.root, ...sparse2.createdChildren];
|
|
174995
|
+
assertStoredClosuresKeepNoCaptures({
|
|
174996
|
+
sourceValueId,
|
|
174997
|
+
rows: evaluatedRows,
|
|
174998
|
+
constructors: document.constructors ?? []
|
|
174999
|
+
});
|
|
175000
|
+
roots.push({
|
|
175001
|
+
sourceValueId,
|
|
175002
|
+
rows: evaluatedRows.map((row) => ({ ...row }))
|
|
175003
|
+
});
|
|
175004
|
+
for (const row of evaluatedRows) {
|
|
175005
|
+
records3.set(`value:${row.id}`, {
|
|
175006
|
+
recordKind: "value",
|
|
175007
|
+
recordId: row.id,
|
|
175008
|
+
contentHash: "local-materialization",
|
|
175009
|
+
deleted: false,
|
|
175010
|
+
data: row
|
|
175011
|
+
});
|
|
175012
|
+
}
|
|
175013
|
+
batch.upsert(evaluatedRows);
|
|
175014
|
+
},
|
|
175015
|
+
onFailure
|
|
175016
|
+
);
|
|
175017
|
+
if (validatesTouched && failures.length === 0) {
|
|
174111
175018
|
assertPulledConstructorsCompiled(pulledDocument);
|
|
174112
175019
|
const batchDocument = batch.document();
|
|
174113
175020
|
const document = {
|
|
@@ -174116,19 +175023,34 @@ function materializeInitializersLocallyV4(args) {
|
|
|
174116
175023
|
values: batchDocument.values,
|
|
174117
175024
|
databaseVM: batchDocument.databaseVM
|
|
174118
175025
|
};
|
|
174119
|
-
|
|
174120
|
-
|
|
174121
|
-
|
|
174122
|
-
|
|
174123
|
-
|
|
174124
|
-
|
|
174125
|
-
|
|
174126
|
-
|
|
174127
|
-
|
|
174128
|
-
|
|
174129
|
-
|
|
175026
|
+
try {
|
|
175027
|
+
assertTouchedInitializersConstruct({
|
|
175028
|
+
document: {
|
|
175029
|
+
...document,
|
|
175030
|
+
initializerCompiler: documentInitializerCompiler(
|
|
175031
|
+
document,
|
|
175032
|
+
compilationProject
|
|
175033
|
+
)
|
|
175034
|
+
},
|
|
175035
|
+
prepared: written,
|
|
175036
|
+
replayedValueIds: replayedRoots
|
|
175037
|
+
});
|
|
175038
|
+
} catch (error) {
|
|
175039
|
+
if (onFailure === void 0) throw error;
|
|
175040
|
+
onFailure([], error);
|
|
175041
|
+
}
|
|
175042
|
+
}
|
|
175043
|
+
for (const [id2, location3] of args.localReferenceLocations ?? []) {
|
|
175044
|
+
if (resolvedLocalIds.has(id2)) continue;
|
|
175045
|
+
if (unavailableRootIds.has(location3.rootId)) continue;
|
|
175046
|
+
const target = storedValueAtPathV4(
|
|
175047
|
+
batch.valuesById,
|
|
175048
|
+
location3.rootId,
|
|
175049
|
+
location3.path
|
|
175050
|
+
);
|
|
175051
|
+
if (target !== null) resolvedLocalIds.set(id2, target);
|
|
174130
175052
|
}
|
|
174131
|
-
return { roots };
|
|
175053
|
+
return { roots, resolvedLocalIds, failures, unavailableRootIds };
|
|
174132
175054
|
}
|
|
174133
175055
|
function prospectiveInitializerRecordsV4(args) {
|
|
174134
175056
|
const records3 = /* @__PURE__ */ new Map();
|
|
@@ -174180,6 +175102,39 @@ function prospectiveInitializerRecordsV4(args) {
|
|
|
174180
175102
|
});
|
|
174181
175103
|
}
|
|
174182
175104
|
}
|
|
175105
|
+
const missingBindings = /* @__PURE__ */ new Set();
|
|
175106
|
+
for (const record7 of records3.values()) {
|
|
175107
|
+
if (record7.recordKind !== "value") continue;
|
|
175108
|
+
const stamp = getField(record7.data, "genericBindings");
|
|
175109
|
+
if (!isObjectRecord(stamp)) continue;
|
|
175110
|
+
for (const id2 of Object.values(stamp)) {
|
|
175111
|
+
if (typeof id2 === "string" && !records3.has(`member:${id2}`))
|
|
175112
|
+
missingBindings.add(id2);
|
|
175113
|
+
}
|
|
175114
|
+
}
|
|
175115
|
+
if (missingBindings.size > 0) {
|
|
175116
|
+
for (const record7 of records3.values()) {
|
|
175117
|
+
if (record7.recordKind !== "class") continue;
|
|
175118
|
+
const classId = record7.recordId;
|
|
175119
|
+
const id2 = isPendingId(classId) ? pendingAnimationChildBindingMemberId(classId) : worldAnimationChildOverrideBindingMemberId(classId);
|
|
175120
|
+
if (!missingBindings.has(id2)) continue;
|
|
175121
|
+
records3.set(`member:${id2}`, {
|
|
175122
|
+
recordKind: "member",
|
|
175123
|
+
recordId: id2,
|
|
175124
|
+
contentHash: "local-binding",
|
|
175125
|
+
deleted: false,
|
|
175126
|
+
data: {
|
|
175127
|
+
...worldAnimationChildOverrideBindingMember(
|
|
175128
|
+
args.workspace.config.projectId,
|
|
175129
|
+
classId
|
|
175130
|
+
),
|
|
175131
|
+
id: id2,
|
|
175132
|
+
createdAt: 0,
|
|
175133
|
+
updatedAt: 0
|
|
175134
|
+
}
|
|
175135
|
+
});
|
|
175136
|
+
}
|
|
175137
|
+
}
|
|
174183
175138
|
return records3;
|
|
174184
175139
|
}
|
|
174185
175140
|
function setSeedValueRecord(records3, data) {
|
|
@@ -174258,10 +175213,12 @@ var cleanRetainedCode, pulledStateDocuments;
|
|
|
174258
175213
|
var init_local_initializer_materialization = __esm({
|
|
174259
175214
|
"src/project-source/local-initializer-materialization.ts"() {
|
|
174260
175215
|
"use strict";
|
|
175216
|
+
init_animation_child_binding_id();
|
|
175217
|
+
init_world_system_classes();
|
|
175218
|
+
init_stored_value_placements();
|
|
174261
175219
|
init_local_project_file_storage();
|
|
174262
175220
|
init_immutable_json3();
|
|
174263
175221
|
init_lexer();
|
|
174264
|
-
init_init_source();
|
|
174265
175222
|
init_NSGetterRuntimeError();
|
|
174266
175223
|
init_runtime_diagnostic();
|
|
174267
175224
|
init_evaluateInitializer();
|
|
@@ -176955,6 +177912,7 @@ function lowerProjectSchemaV4(base, analysis, options = {}) {
|
|
|
176955
177912
|
);
|
|
176956
177913
|
for (const extension of analysis.schema.extensions ?? [])
|
|
176957
177914
|
lowerExtension(context, extension);
|
|
177915
|
+
retainStoredMemberDependencies(context);
|
|
176958
177916
|
normalizeLookupDeclaredTypes(context);
|
|
176959
177917
|
for (const [memberId, placements] of context.placements) {
|
|
176960
177918
|
const member = context.loweredMembers.get(memberId);
|
|
@@ -176963,9 +177921,6 @@ function lowerProjectSchemaV4(base, analysis, options = {}) {
|
|
|
176963
177921
|
context.loweredMembers.set(memberId, { ...member, owner });
|
|
176964
177922
|
}
|
|
176965
177923
|
const protectedRootMembers = lowerProtectedRootMembers(base, analysis);
|
|
176966
|
-
const structuralMembers = base.members.filter(
|
|
176967
|
-
(member) => (member.owner.kind === "genericArgument" || member.owner.kind === "sharedGenericArgument") && !context.loweredMembers.has(member.id)
|
|
176968
|
-
);
|
|
176969
177924
|
return {
|
|
176970
177925
|
...base,
|
|
176971
177926
|
classes,
|
|
@@ -176974,8 +177929,7 @@ function lowerProjectSchemaV4(base, analysis, options = {}) {
|
|
|
176974
177929
|
...context.loweredMembers.values(),
|
|
176975
177930
|
...protectedRootMembers.filter(
|
|
176976
177931
|
(member) => !context.loweredMembers.has(member.id)
|
|
176977
|
-
)
|
|
176978
|
-
...structuralMembers
|
|
177932
|
+
)
|
|
176979
177933
|
],
|
|
176980
177934
|
interfaces,
|
|
176981
177935
|
enums: analysis.schema.enums.map(
|
|
@@ -176986,6 +177940,43 @@ function lowerProjectSchemaV4(base, analysis, options = {}) {
|
|
|
176986
177940
|
internalRecordRelations: lowerRelations(context, analysis)
|
|
176987
177941
|
};
|
|
176988
177942
|
}
|
|
177943
|
+
function retainStoredMemberDependencies(context) {
|
|
177944
|
+
const retain = (memberId) => {
|
|
177945
|
+
if (context.loweredMembers.has(memberId)) return;
|
|
177946
|
+
const member = context.baseMembers.get(memberId);
|
|
177947
|
+
if (member === void 0)
|
|
177948
|
+
throw new Error(
|
|
177949
|
+
`Stored generic or collection descriptor ${memberId} is missing.`
|
|
177950
|
+
);
|
|
177951
|
+
context.loweredMembers.set(memberId, member);
|
|
177952
|
+
};
|
|
177953
|
+
const retainDependencies = (member) => {
|
|
177954
|
+
switch (member.kind) {
|
|
177955
|
+
case "class":
|
|
177956
|
+
for (const binding of Object.values(member.classArguments))
|
|
177957
|
+
if (binding.kind === "member") retain(binding.memberId);
|
|
177958
|
+
break;
|
|
177959
|
+
case "interface":
|
|
177960
|
+
for (const binding of Object.values(member.interfaceArguments))
|
|
177961
|
+
if (binding.kind === "member") retain(binding.memberId);
|
|
177962
|
+
break;
|
|
177963
|
+
case "list":
|
|
177964
|
+
case "set":
|
|
177965
|
+
case "dictionary":
|
|
177966
|
+
retain(member.entryMemberId);
|
|
177967
|
+
break;
|
|
177968
|
+
case "tuple":
|
|
177969
|
+
for (const element of member.elementMemberIds) retain(element);
|
|
177970
|
+
break;
|
|
177971
|
+
}
|
|
177972
|
+
};
|
|
177973
|
+
for (const member of context.baseMembers.values()) {
|
|
177974
|
+
if (member.owner.kind === "loose" && !context.loweredMembers.has(member.id))
|
|
177975
|
+
retainDependencies(member);
|
|
177976
|
+
}
|
|
177977
|
+
for (const member of context.loweredMembers.values())
|
|
177978
|
+
retainDependencies(member);
|
|
177979
|
+
}
|
|
176989
177980
|
function lowerProtectedRootMembers(base, analysis) {
|
|
176990
177981
|
const candidates = PROJECT_ROOT_SOURCE_SLOTS.map(
|
|
176991
177982
|
(slot) => base.members.filter(
|
|
@@ -180490,48 +181481,60 @@ function recordDeleteChange(base, file) {
|
|
|
180490
181481
|
casBaseHash: base.conflictServerHash ?? base.contentHash
|
|
180491
181482
|
};
|
|
180492
181483
|
}
|
|
180493
|
-
function
|
|
180494
|
-
const
|
|
181484
|
+
function appendOwnedSchemaMemberDeletes(workspace, reconstructed3, changes, baseManifest) {
|
|
181485
|
+
const owners = /* @__PURE__ */ new Set();
|
|
181486
|
+
const deleted = /* @__PURE__ */ new Set();
|
|
180495
181487
|
for (const change of changes) {
|
|
180496
|
-
if (change.
|
|
180497
|
-
if (
|
|
180498
|
-
|
|
180499
|
-
|
|
181488
|
+
if (change.kind === "create") continue;
|
|
181489
|
+
if (!["class", "interface", "member"].includes(change.recordKind)) continue;
|
|
181490
|
+
owners.add(change.recordId);
|
|
181491
|
+
if (change.kind === "delete") deleted.add(change.recordId);
|
|
181492
|
+
const record7 = workspace.state.records[recordStateKey(change.recordKind, change.recordId)];
|
|
181493
|
+
const data = record7 === void 0 ? void 0 : effectiveRecordData(record7);
|
|
181494
|
+
const parameters = isObjectRecord(data) ? data.genericParams : void 0;
|
|
181495
|
+
if (Array.isArray(parameters)) {
|
|
181496
|
+
for (const parameter4 of parameters) {
|
|
181497
|
+
if (isObjectRecord(parameter4) && typeof parameter4.id === "string")
|
|
181498
|
+
owners.add(parameter4.id);
|
|
181499
|
+
}
|
|
180500
181500
|
}
|
|
180501
|
-
const base = workspace.state.records[recordStateKey("member", change.recordId)];
|
|
180502
|
-
if (base === void 0) continue;
|
|
180503
|
-
const data = effectiveRecordData(base);
|
|
180504
|
-
if (isObjectRecord(data) && typeof data.entryMemberId === "string" && data.entryMemberId !== change.nextData?.entryMemberId)
|
|
180505
|
-
releasedOwnerIds.add(change.recordId);
|
|
180506
181501
|
}
|
|
180507
|
-
if (
|
|
180508
|
-
const
|
|
180509
|
-
|
|
180510
|
-
|
|
180511
|
-
|
|
180512
|
-
|
|
180513
|
-
|
|
180514
|
-
|
|
180515
|
-
|
|
180516
|
-
|
|
181502
|
+
if (owners.size === 0) return;
|
|
181503
|
+
const children3 = /* @__PURE__ */ new Map();
|
|
181504
|
+
const add = (parent, child2) => {
|
|
181505
|
+
const entries = children3.get(parent) ?? [];
|
|
181506
|
+
entries.push(child2);
|
|
181507
|
+
children3.set(parent, entries);
|
|
181508
|
+
};
|
|
181509
|
+
for (const member of baseManifest?.members ?? []) {
|
|
181510
|
+
switch (member.owner.kind) {
|
|
181511
|
+
case "genericArgument":
|
|
181512
|
+
add(member.owner.parentRecordId, member.id);
|
|
181513
|
+
break;
|
|
181514
|
+
case "sharedGenericArgument":
|
|
181515
|
+
for (const binding of member.owner.bindings)
|
|
181516
|
+
add(binding.parentRecordId, member.id);
|
|
181517
|
+
break;
|
|
181518
|
+
case "collectionEntry":
|
|
181519
|
+
add(member.owner.parentMemberId, member.id);
|
|
181520
|
+
break;
|
|
181521
|
+
case "sharedCollectionEntry":
|
|
181522
|
+
for (const parent of member.owner.parentMemberIds)
|
|
181523
|
+
add(parent, member.id);
|
|
181524
|
+
break;
|
|
181525
|
+
}
|
|
180517
181526
|
}
|
|
180518
|
-
for (const
|
|
180519
|
-
|
|
180520
|
-
|
|
180521
|
-
|
|
180522
|
-
|
|
180523
|
-
|
|
180524
|
-
|
|
180525
|
-
|
|
180526
|
-
|
|
180527
|
-
|
|
180528
|
-
|
|
180529
|
-
if (releasedOwnerIds.has(id2)) continue;
|
|
180530
|
-
const key = recordStateKey("member", id2);
|
|
180531
|
-
if (reconstructed3.has(key)) continue;
|
|
180532
|
-
const base = workspace.state.records[key];
|
|
180533
|
-
if (base === void 0 || base.conflictServerHash === null) continue;
|
|
180534
|
-
changes.push(recordDeleteChange(base, base.file ?? null));
|
|
181527
|
+
for (const ownerId of owners) {
|
|
181528
|
+
for (const memberId of children3.get(ownerId) ?? []) {
|
|
181529
|
+
const key = recordStateKey("member", memberId);
|
|
181530
|
+
if (reconstructed3.has(key)) continue;
|
|
181531
|
+
owners.add(memberId);
|
|
181532
|
+
if (deleted.has(memberId)) continue;
|
|
181533
|
+
const base = workspace.state.records[key];
|
|
181534
|
+
if (base === void 0 || base.conflictServerHash === null) continue;
|
|
181535
|
+
deleted.add(memberId);
|
|
181536
|
+
changes.push(recordDeleteChange(base, base.file ?? null));
|
|
181537
|
+
}
|
|
180535
181538
|
}
|
|
180536
181539
|
}
|
|
180537
181540
|
function listVirtualProjectSourceFilesV4(files) {
|
|
@@ -180556,10 +181559,16 @@ function compareWorkspacePaths(left, right) {
|
|
|
180556
181559
|
if (left > right) return 1;
|
|
180557
181560
|
return 0;
|
|
180558
181561
|
}
|
|
180559
|
-
function materializeWorkspaceStatusInitializers(workspace, status, forceRecompile) {
|
|
181562
|
+
function materializeWorkspaceStatusInitializers(workspace, status, forceRecompile, collectErrors = false) {
|
|
180560
181563
|
return materializeInitializersLocallyV4({
|
|
180561
181564
|
workspace,
|
|
180562
181565
|
forceRecompile,
|
|
181566
|
+
collectErrors,
|
|
181567
|
+
localReferenceLocations: new Map(
|
|
181568
|
+
[...status.pendingValueIdentitySites ?? []].flatMap(
|
|
181569
|
+
([id2, site]) => site.materializedLocation === void 0 ? [] : [[id2, site.materializedLocation]]
|
|
181570
|
+
)
|
|
181571
|
+
),
|
|
180563
181572
|
changes: status.changes.map((change) => ({
|
|
180564
181573
|
recordKind: change.recordKind,
|
|
180565
181574
|
recordId: change.recordId,
|
|
@@ -181565,12 +182574,19 @@ function computeStatus(workspace, options, conflictedFiles, parseErrors, parseWa
|
|
|
181565
182574
|
}
|
|
181566
182575
|
changes.push(recordDeleteChange(recordState, recordFile));
|
|
181567
182576
|
}
|
|
181568
|
-
|
|
182577
|
+
appendOwnedSchemaMemberDeletes(
|
|
182578
|
+
workspace,
|
|
182579
|
+
reconstructed3,
|
|
182580
|
+
changes,
|
|
182581
|
+
baseManifest
|
|
182582
|
+
);
|
|
182583
|
+
const deferredReferences = [];
|
|
181569
182584
|
const referenceFailures = drainValueReferenceObligationsV4(
|
|
181570
182585
|
prospectiveState,
|
|
181571
182586
|
manifest,
|
|
181572
182587
|
{
|
|
181573
182588
|
registry: valueLowerRegistry,
|
|
182589
|
+
deferredReferences,
|
|
181574
182590
|
analysis: projectAnalysisV4,
|
|
181575
182591
|
deletedValueIds,
|
|
181576
182592
|
unavailableReferenceMemberIds,
|
|
@@ -181621,6 +182637,17 @@ function computeStatus(workspace, options, conflictedFiles, parseErrors, parseWa
|
|
|
181621
182637
|
reconciliations: valueLowerRegistry.initializerReconciliations
|
|
181622
182638
|
});
|
|
181623
182639
|
}
|
|
182640
|
+
const localReferenceTargets = valueLowerRegistry.localValues?.referenceTargets();
|
|
182641
|
+
if (localReferenceTargets !== void 0 && localReferenceTargets.size > 0) {
|
|
182642
|
+
const rewrite = createIdentityRewriter(localReferenceTargets);
|
|
182643
|
+
authoredValueSeeds = settleInitializerKeyCode({
|
|
182644
|
+
settle: rewrite,
|
|
182645
|
+
seeds: authoredValueSeeds,
|
|
182646
|
+
reconstructed: reconstructed3,
|
|
182647
|
+
changes,
|
|
182648
|
+
reconciliations: valueLowerRegistry.initializerReconciliations
|
|
182649
|
+
});
|
|
182650
|
+
}
|
|
181624
182651
|
try {
|
|
181625
182652
|
const listeners = lowerListenerBindings({
|
|
181626
182653
|
statements: projectAnalysisV4?.listenerStatements,
|
|
@@ -181984,16 +183011,143 @@ function computeStatus(workspace, options, conflictedFiles, parseErrors, parseWa
|
|
|
181984
183011
|
)
|
|
181985
183012
|
);
|
|
181986
183013
|
}
|
|
181987
|
-
|
|
181988
|
-
|
|
181989
|
-
|
|
181990
|
-
|
|
181991
|
-
|
|
181992
|
-
|
|
181993
|
-
|
|
181994
|
-
|
|
181995
|
-
|
|
181996
|
-
|
|
183014
|
+
const hasUnresolvedLocalReferences = deferredReferences.length > 0 || [...localReferenceTargets?.values() ?? []].some(
|
|
183015
|
+
(id2) => valueLowerRegistry.pendingValueIdentitySites.get(id2)?.materializedLocation !== void 0
|
|
183016
|
+
);
|
|
183017
|
+
if (hasUnresolvedLocalReferences || options.skipInitializerMaterialization !== true && !parseErrors.some(isBlockingSchemaSourceError)) {
|
|
183018
|
+
if (hasUnresolvedLocalReferences) {
|
|
183019
|
+
try {
|
|
183020
|
+
const materialized = materializeWorkspaceStatusInitializers(
|
|
183021
|
+
workspace,
|
|
183022
|
+
{
|
|
183023
|
+
changes,
|
|
183024
|
+
authoredValueSeeds,
|
|
183025
|
+
pendingValueIdentitySites: valueLowerRegistry.pendingValueIdentitySites
|
|
183026
|
+
},
|
|
183027
|
+
options.forceRecompile,
|
|
183028
|
+
true
|
|
183029
|
+
);
|
|
183030
|
+
for (const error of materialized.failures ?? [])
|
|
183031
|
+
parseErrors.push(
|
|
183032
|
+
initializerRuntimeDiagnostic(
|
|
183033
|
+
error,
|
|
183034
|
+
valueLowerRegistry.initializerSites,
|
|
183035
|
+
sourceTextByUri,
|
|
183036
|
+
projectAnalysisV4
|
|
183037
|
+
)
|
|
183038
|
+
);
|
|
183039
|
+
const unavailableValueIds = new Set(rootValues.unavailableValueIds);
|
|
183040
|
+
for (const id2 of materialized.unavailableRootIds ?? [])
|
|
183041
|
+
unavailableValueIds.add(id2);
|
|
183042
|
+
for (const [id2, site] of valueLowerRegistry.pendingValueIdentitySites) {
|
|
183043
|
+
if (site.materializedLocation !== void 0 && materialized.unavailableRootIds?.has(
|
|
183044
|
+
site.materializedLocation.rootId
|
|
183045
|
+
))
|
|
183046
|
+
unavailableValueIds.add(id2);
|
|
183047
|
+
}
|
|
183048
|
+
for (const [id2, target] of materialized.resolvedLocalIds ?? []) {
|
|
183049
|
+
const site = valueLowerRegistry.pendingValueIdentitySites.get(id2);
|
|
183050
|
+
if (site !== void 0) {
|
|
183051
|
+
valueLowerRegistry.pendingValueIdentitySites.delete(id2);
|
|
183052
|
+
valueLowerRegistry.pendingValueIdentitySites.set(target, {
|
|
183053
|
+
...site,
|
|
183054
|
+
id: target
|
|
183055
|
+
});
|
|
183056
|
+
}
|
|
183057
|
+
}
|
|
183058
|
+
valueLowerRegistry.localValues?.remapTargets(
|
|
183059
|
+
materialized.resolvedLocalIds ?? /* @__PURE__ */ new Map()
|
|
183060
|
+
);
|
|
183061
|
+
const rewrite = createIdentityRewriter(
|
|
183062
|
+
materialized.resolvedLocalIds ?? /* @__PURE__ */ new Map()
|
|
183063
|
+
);
|
|
183064
|
+
authoredValueSeeds = settleInitializerKeyCode({
|
|
183065
|
+
settle: rewrite,
|
|
183066
|
+
references: materialized.resolvedLocalIds,
|
|
183067
|
+
seeds: authoredValueSeeds,
|
|
183068
|
+
reconstructed: reconstructed3,
|
|
183069
|
+
changes,
|
|
183070
|
+
reconciliations: valueLowerRegistry.initializerReconciliations
|
|
183071
|
+
});
|
|
183072
|
+
if (deferredReferences.length > 0) {
|
|
183073
|
+
const materializedState = { ...prospectiveState };
|
|
183074
|
+
const pendingValues = new Map(valueLowerRegistry.pendingValues);
|
|
183075
|
+
for (const root of materialized.roots) {
|
|
183076
|
+
for (const row of root.rows) {
|
|
183077
|
+
if (typeof row.id !== "string") continue;
|
|
183078
|
+
pendingValues.delete(row.id);
|
|
183079
|
+
materializedState[`value:${row.id}`] = {
|
|
183080
|
+
recordKind: "value",
|
|
183081
|
+
recordId: row.id,
|
|
183082
|
+
contentHash: "",
|
|
183083
|
+
data: row
|
|
183084
|
+
};
|
|
183085
|
+
}
|
|
183086
|
+
}
|
|
183087
|
+
const validationRegistry = { ...valueLowerRegistry, pendingValues };
|
|
183088
|
+
const failures = drainValueReferenceObligationsV4(
|
|
183089
|
+
materializedState,
|
|
183090
|
+
manifest,
|
|
183091
|
+
{
|
|
183092
|
+
registry: validationRegistry,
|
|
183093
|
+
analysis: projectAnalysisV4,
|
|
183094
|
+
obligations: deferredReferences,
|
|
183095
|
+
deletedValueIds,
|
|
183096
|
+
unavailableReferenceMemberIds,
|
|
183097
|
+
unavailableValueIds,
|
|
183098
|
+
sourceTextByUri,
|
|
183099
|
+
resolveRootPath: createRootValuePathResolverV4({
|
|
183100
|
+
manifest,
|
|
183101
|
+
state: materializedState,
|
|
183102
|
+
resolveVirtualPath,
|
|
183103
|
+
unavailableSlots: rootValues.unavailableSlots,
|
|
183104
|
+
registry: validationRegistry,
|
|
183105
|
+
initBuiltSlots: "refuse"
|
|
183106
|
+
})
|
|
183107
|
+
}
|
|
183108
|
+
);
|
|
183109
|
+
for (const failure of failures) {
|
|
183110
|
+
parseErrors.push(
|
|
183111
|
+
failure instanceof SchemaSourceError ? failure : new SchemaSourceError(
|
|
183112
|
+
failure.message,
|
|
183113
|
+
failure.file,
|
|
183114
|
+
failure.line,
|
|
183115
|
+
failure.column,
|
|
183116
|
+
failure.code
|
|
183117
|
+
)
|
|
183118
|
+
);
|
|
183119
|
+
}
|
|
183120
|
+
if (failures.length > 0)
|
|
183121
|
+
return refusedStatus(
|
|
183122
|
+
conflictedFiles,
|
|
183123
|
+
uniqueSourceErrors(parseErrors),
|
|
183124
|
+
parseWarnings
|
|
183125
|
+
);
|
|
183126
|
+
}
|
|
183127
|
+
} catch (error) {
|
|
183128
|
+
const diagnostic = initializerRuntimeDiagnostic(
|
|
183129
|
+
error,
|
|
183130
|
+
valueLowerRegistry.initializerSites,
|
|
183131
|
+
sourceTextByUri,
|
|
183132
|
+
projectAnalysisV4
|
|
183133
|
+
);
|
|
183134
|
+
parseErrors.push(diagnostic);
|
|
183135
|
+
}
|
|
183136
|
+
} else {
|
|
183137
|
+
const diagnostic = workspaceStatusInitializerDiagnostic(
|
|
183138
|
+
workspace,
|
|
183139
|
+
{
|
|
183140
|
+
changes,
|
|
183141
|
+
authoredValueSeeds,
|
|
183142
|
+
pendingValueIdentitySites: valueLowerRegistry.pendingValueIdentitySites
|
|
183143
|
+
},
|
|
183144
|
+
valueLowerRegistry.initializerSites,
|
|
183145
|
+
sourceTextByUri,
|
|
183146
|
+
projectAnalysisV4,
|
|
183147
|
+
options.forceRecompile
|
|
183148
|
+
);
|
|
183149
|
+
if (diagnostic !== null) parseErrors.push(diagnostic);
|
|
183150
|
+
}
|
|
181997
183151
|
reportPhase("initializer-materialization");
|
|
181998
183152
|
}
|
|
181999
183153
|
const dialogueBodyErrors = workspaceStatusDialogueBodyErrors(
|
|
@@ -182437,8 +183591,15 @@ function expandProspectiveAnimationInstances(document) {
|
|
|
182437
183591
|
}
|
|
182438
183592
|
function applyConstructionRebuildsV4(args) {
|
|
182439
183593
|
if (args.rebuilds.length === 0) return;
|
|
183594
|
+
const covered = /* @__PURE__ */ new Set();
|
|
183595
|
+
for (const rebuild of args.rebuilds)
|
|
183596
|
+
for (const id2 of rebuild.ownedValueIds)
|
|
183597
|
+
if (id2 !== rebuild.valueId) covered.add(id2);
|
|
183598
|
+
const roots = args.rebuilds.filter(
|
|
183599
|
+
(rebuild) => !covered.has(rebuild.valueId)
|
|
183600
|
+
);
|
|
182440
183601
|
const replanned = /* @__PURE__ */ new Set();
|
|
182441
|
-
for (const rebuild of
|
|
183602
|
+
for (const rebuild of roots) {
|
|
182442
183603
|
for (const id2 of rebuild.ownedValueIds) {
|
|
182443
183604
|
if (id2 === rebuild.valueId) continue;
|
|
182444
183605
|
const key = recordStateKey("value", id2);
|
|
@@ -182463,7 +183624,7 @@ function applyConstructionRebuildsV4(args) {
|
|
|
182463
183624
|
const key = recordStateKey(change.recordKind, change.recordId);
|
|
182464
183625
|
if (!replanned.has(key)) output.set(key, change);
|
|
182465
183626
|
}
|
|
182466
|
-
for (const rebuild of
|
|
183627
|
+
for (const rebuild of roots) {
|
|
182467
183628
|
const key = recordStateKey("value", rebuild.valueId);
|
|
182468
183629
|
const base = args.workspace.state.records[key];
|
|
182469
183630
|
if (base === void 0) {
|
|
@@ -183171,7 +184332,18 @@ function manifestRecordSources(manifest) {
|
|
|
183171
184332
|
return result;
|
|
183172
184333
|
}
|
|
183173
184334
|
function settleInitializerKeyCode(args) {
|
|
184335
|
+
const settleValue = (value) => {
|
|
184336
|
+
if (args.references === void 0) return value;
|
|
184337
|
+
if (typeof value === "string") return args.references.get(value) ?? value;
|
|
184338
|
+
if (Array.isArray(value)) return value.map(settleValue);
|
|
184339
|
+
if (!isObjectRecord(value)) return value;
|
|
184340
|
+
return Object.fromEntries(
|
|
184341
|
+
Object.entries(value).map(([key, entry]) => [key, settleValue(entry)])
|
|
184342
|
+
);
|
|
184343
|
+
};
|
|
183174
184344
|
const settleInit = (data) => {
|
|
184345
|
+
if ("value" in data && args.references !== void 0)
|
|
184346
|
+
data = { ...data, value: settleValue(data.value) };
|
|
183175
184347
|
const init = data.init;
|
|
183176
184348
|
if (!isObjectRecord(init)) return data;
|
|
183177
184349
|
if (typeof init.code !== "string") return data;
|
|
@@ -183189,10 +184361,17 @@ function settleInitializerKeyCode(args) {
|
|
|
183189
184361
|
for (const [valueId, reconciliation] of args.reconciliations) {
|
|
183190
184362
|
args.reconciliations.set(valueId, {
|
|
183191
184363
|
...reconciliation,
|
|
183192
|
-
code: args.settle(reconciliation.code)
|
|
184364
|
+
code: args.settle(reconciliation.code),
|
|
184365
|
+
...reconciliation.kind === "retainedLiteral" ? {} : { constructionCode: args.settle(reconciliation.constructionCode) }
|
|
183193
184366
|
});
|
|
183194
184367
|
}
|
|
183195
|
-
const settleNode = (node) =>
|
|
184368
|
+
const settleNode = (node) => {
|
|
184369
|
+
if (node.nodeType === "initializer")
|
|
184370
|
+
return { ...node, code: args.settle(node.code) };
|
|
184371
|
+
if (node.nodeType === "literal" && args.references !== void 0)
|
|
184372
|
+
return { ...node, value: settleValue(node.value) };
|
|
184373
|
+
return node;
|
|
184374
|
+
};
|
|
183196
184375
|
return new Map(
|
|
183197
184376
|
Array.from(args.seeds, ([memberId, seed]) => [
|
|
183198
184377
|
memberId,
|
|
@@ -183277,6 +184456,7 @@ var sourceSchemaValidation, pulledAnimationValues, animationCompilationProject,
|
|
|
183277
184456
|
var init_workspace_status_core = __esm({
|
|
183278
184457
|
"src/project-source/workspace-status-core.ts"() {
|
|
183279
184458
|
"use strict";
|
|
184459
|
+
init_identity_rewriter();
|
|
183280
184460
|
init_initializer_replay();
|
|
183281
184461
|
init_project_version_whole_graph_validation();
|
|
183282
184462
|
init_record_fields();
|
|
@@ -183349,7 +184529,6 @@ var init_workspace_status_core = __esm({
|
|
|
183349
184529
|
init_materialized_construction_cache();
|
|
183350
184530
|
init_project_version_whole_graph_validation();
|
|
183351
184531
|
init_value_base_desync();
|
|
183352
|
-
init_inheritance();
|
|
183353
184532
|
sourceSchemaValidation = createSchemaDocumentMemo();
|
|
183354
184533
|
pulledAnimationValues = /* @__PURE__ */ new WeakMap();
|
|
183355
184534
|
animationCompilationProject = createNeoScriptProjectMemo();
|
|
@@ -184819,7 +185998,7 @@ var init_project_document_cache = __esm({
|
|
|
184819
185998
|
init_registry();
|
|
184820
185999
|
init_project_documents();
|
|
184821
186000
|
PROJECT_SOURCE_BUILD_CACHE_PATH = ".neo/build/project-source-analysis-v4.json";
|
|
184822
|
-
PROJECT_SOURCE_BUILD_CACHE_REVISION =
|
|
186001
|
+
PROJECT_SOURCE_BUILD_CACHE_REVISION = 10;
|
|
184823
186002
|
analysisCache = /* @__PURE__ */ new Map();
|
|
184824
186003
|
MAX_CACHED_WORKSPACES = 4;
|
|
184825
186004
|
parsedWorkspaceDocuments = /* @__PURE__ */ new Map();
|
|
@@ -221768,7 +222947,7 @@ import {
|
|
|
221768
222947
|
statSync as statSync7
|
|
221769
222948
|
} from "node:fs";
|
|
221770
222949
|
import { join as join22, relative as relative8, sep as sep9 } from "node:path";
|
|
221771
|
-
function assignPendingIds(changes, authoredValueSeeds, reconstructed3, previousLedger = {}) {
|
|
222950
|
+
function assignPendingIds(changes, authoredValueSeeds, reconstructed3, previousLedger = {}, codePendingIdCandidates = []) {
|
|
221772
222951
|
const assigned = /* @__PURE__ */ new Map();
|
|
221773
222952
|
const minted = /* @__PURE__ */ new Map();
|
|
221774
222953
|
let mint = (pendingId2) => {
|
|
@@ -221779,6 +222958,21 @@ function assignPendingIds(changes, authoredValueSeeds, reconstructed3, previousL
|
|
|
221779
222958
|
const assign = (pendingId2) => {
|
|
221780
222959
|
const existing = assigned.get(pendingId2);
|
|
221781
222960
|
if (existing !== void 0) return existing;
|
|
222961
|
+
const animationClass = pendingAnimationChildBindingClassId(pendingId2);
|
|
222962
|
+
if (animationClass !== null) {
|
|
222963
|
+
const classId = isPendingId(animationClass) ? assign(animationClass) : animationClass;
|
|
222964
|
+
const derived = worldAnimationChildOverrideBindingMemberId(classId);
|
|
222965
|
+
assigned.set(pendingId2, derived);
|
|
222966
|
+
return derived;
|
|
222967
|
+
}
|
|
222968
|
+
const genericArgument = pendingGenericArgumentIdentity(pendingId2);
|
|
222969
|
+
if (genericArgument !== null) {
|
|
222970
|
+
const parent = isPendingId(genericArgument.parentRecordId) ? assign(genericArgument.parentRecordId) : genericArgument.parentRecordId;
|
|
222971
|
+
const parameter4 = isPendingId(genericArgument.genericParamId) ? assign(genericArgument.genericParamId) : genericArgument.genericParamId;
|
|
222972
|
+
const derived = derivedGenericArgumentMemberId(parent, parameter4);
|
|
222973
|
+
assigned.set(pendingId2, derived);
|
|
222974
|
+
return derived;
|
|
222975
|
+
}
|
|
221782
222976
|
const pendingVirtual = pendingVirtualValueIdentity(pendingId2);
|
|
221783
222977
|
if (pendingVirtual !== null) {
|
|
221784
222978
|
const instanceRootId = isPendingId(pendingVirtual.instanceRootId) ? assign(pendingVirtual.instanceRootId) : pendingVirtual.instanceRootId;
|
|
@@ -221880,6 +223074,24 @@ function assignPendingIds(changes, authoredValueSeeds, reconstructed3, previousL
|
|
|
221880
223074
|
collect(record7.fullData);
|
|
221881
223075
|
}
|
|
221882
223076
|
}
|
|
223077
|
+
const codeCandidates = new Set(codePendingIdCandidates);
|
|
223078
|
+
if (codeCandidates.size > 0) {
|
|
223079
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
223080
|
+
const collectCodeIds = (value) => {
|
|
223081
|
+
if (value === null || typeof value !== "object" || seen.has(value))
|
|
223082
|
+
return;
|
|
223083
|
+
seen.add(value);
|
|
223084
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
223085
|
+
if (key === "code" && typeof entry === "string" && entry.includes(PENDING_ID_PREFIX)) {
|
|
223086
|
+
for (const token of lex(entry).tokens)
|
|
223087
|
+
if (token.value !== void 0 && codeCandidates.has(token.value))
|
|
223088
|
+
collect(token.value);
|
|
223089
|
+
} else collectCodeIds(entry);
|
|
223090
|
+
}
|
|
223091
|
+
};
|
|
223092
|
+
for (const change of changes) collectCodeIds(change.nextData);
|
|
223093
|
+
for (const seed of authoredValueSeeds.values()) collectCodeIds(seed);
|
|
223094
|
+
}
|
|
221883
223095
|
for (const root of roots) assign(root);
|
|
221884
223096
|
const keys = identityLedgerKeys(minted.keys());
|
|
221885
223097
|
const ledger = {};
|
|
@@ -222809,7 +224021,10 @@ async function prepareLocalPushArtifactsV4(workspace, status, onPhase = () => vo
|
|
|
222809
224021
|
status.changes,
|
|
222810
224022
|
status.authoredValueSeeds,
|
|
222811
224023
|
status.reconstructed,
|
|
222812
|
-
{ ...options.identityLedger, ...latestLedger }
|
|
224024
|
+
{ ...options.identityLedger, ...latestLedger },
|
|
224025
|
+
[...status.pendingValueIdentitySites ?? []].flatMap(
|
|
224026
|
+
([id2, site]) => site.materializedLocation !== void 0 && pendingVirtualValueIdentity(id2) !== null ? [id2] : []
|
|
224027
|
+
)
|
|
222813
224028
|
);
|
|
222814
224029
|
if (!mergeReservedIdentities(workspace.root, pendingAssignment.ledger)) {
|
|
222815
224030
|
throw new Error(
|
|
@@ -222867,6 +224082,18 @@ async function prepareLocalPushArtifactsV4(workspace, status, onPhase = () => vo
|
|
|
222867
224082
|
let prepared;
|
|
222868
224083
|
try {
|
|
222869
224084
|
const preparationArgs2 = {
|
|
224085
|
+
initializerReferenceOwners: new Map(
|
|
224086
|
+
[...status.pendingValueIdentitySites ?? []].flatMap(
|
|
224087
|
+
([id2, site]) => site.materializedLocation === void 0 ? [] : [
|
|
224088
|
+
[
|
|
224089
|
+
pendingAssignment.assigned.get(id2) ?? id2,
|
|
224090
|
+
pendingAssignment.assigned.get(
|
|
224091
|
+
site.materializedLocation.rootId
|
|
224092
|
+
) ?? site.materializedLocation.rootId
|
|
224093
|
+
]
|
|
224094
|
+
]
|
|
224095
|
+
)
|
|
224096
|
+
),
|
|
222870
224097
|
scriptSources: new Map(
|
|
222871
224098
|
[...status.scriptSources ?? []].map(([key, sources2]) => {
|
|
222872
224099
|
const colon = key.indexOf(":");
|
|
@@ -224921,7 +226148,10 @@ var compileNSVoidBody2, compileNSFunction2, compileNSGetter2, compileNSSetter2,
|
|
|
224921
226148
|
var init_push = __esm({
|
|
224922
226149
|
"src/commands/push.ts"() {
|
|
224923
226150
|
"use strict";
|
|
226151
|
+
init_animation_child_binding_id();
|
|
226152
|
+
init_world_system_classes();
|
|
224924
226153
|
init_local_project_file_storage();
|
|
226154
|
+
init_generic_argument_member_id();
|
|
224925
226155
|
init_extension_source_preservation();
|
|
224926
226156
|
init_workspace_lock();
|
|
224927
226157
|
init_export_state();
|
|
@@ -240407,7 +241637,7 @@ var releaseWorkspaceLock = () => void 0;
|
|
|
240407
241637
|
async function main() {
|
|
240408
241638
|
const args = parseArgs(process.argv.slice(2));
|
|
240409
241639
|
if (args.command === "--version") {
|
|
240410
|
-
console.log("0.89.
|
|
241640
|
+
console.log("0.89.10");
|
|
240411
241641
|
return;
|
|
240412
241642
|
}
|
|
240413
241643
|
if (args.command === null || args.command === "help" || args.command === "--help" || args.command === "-h") {
|