@neocompose/cli 0.72.1 → 0.72.4
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 +15 -0
- package/dist/neo.mjs +463 -233
- package/dist/test-worker.mjs +138 -131
- 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-and-construction.md +7 -1
- package/skills/neocompose-cli/references/neoscript.md +11 -1
- package/skills/neocompose-cli/references/values-identities-and-references.md +7 -1
package/dist/test-worker.mjs
CHANGED
|
@@ -33780,14 +33780,17 @@ var Scope = class {
|
|
|
33780
33780
|
return this.invalidatedRoots;
|
|
33781
33781
|
}
|
|
33782
33782
|
effectiveNarrowedPaths() {
|
|
33783
|
-
const effective =
|
|
33784
|
-
|
|
33785
|
-
|
|
33786
|
-
|
|
33783
|
+
const effective = new Map(this.narrowedPaths);
|
|
33784
|
+
const invalidated = new Set(this.invalidatedRoots);
|
|
33785
|
+
for (const root of this.hiddenNarrowingRoots) invalidated.add(root);
|
|
33786
|
+
for (let current = this.parent; current; current = current.parent) {
|
|
33787
|
+
for (const [path, narrowed] of current.narrowedPaths) {
|
|
33788
|
+
if (!effective.has(path) && !invalidated.has(narrowed.rootEntry)) {
|
|
33789
|
+
effective.set(path, narrowed);
|
|
33790
|
+
}
|
|
33787
33791
|
}
|
|
33788
|
-
|
|
33789
|
-
|
|
33790
|
-
effective.set(path, narrowed);
|
|
33792
|
+
for (const root of current.invalidatedRoots) invalidated.add(root);
|
|
33793
|
+
for (const root of current.hiddenNarrowingRoots) invalidated.add(root);
|
|
33791
33794
|
}
|
|
33792
33795
|
return effective;
|
|
33793
33796
|
}
|
|
@@ -33813,6 +33816,9 @@ var Scope = class {
|
|
|
33813
33816
|
hideInheritedNarrowing(rootEntry) {
|
|
33814
33817
|
this.hiddenNarrowingRoots.add(rootEntry);
|
|
33815
33818
|
this.updatePatternType(rootEntry, rootEntry.type);
|
|
33819
|
+
for (const [path, narrowed] of this.narrowedPaths) {
|
|
33820
|
+
if (narrowed.rootEntry === rootEntry) this.narrowedPaths.delete(path);
|
|
33821
|
+
}
|
|
33816
33822
|
}
|
|
33817
33823
|
invalidate(rootEntry) {
|
|
33818
33824
|
this.invalidatedRoots.add(rootEntry);
|
|
@@ -34370,24 +34376,26 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
|
|
|
34370
34376
|
const branchExitNarrowings = [];
|
|
34371
34377
|
const branchExitOwnershipScopes = [];
|
|
34372
34378
|
const branches = statement.branches.map((branch) => {
|
|
34379
|
+
const conditionScope = new Scope(scope);
|
|
34380
|
+
this.applyFactsToScope(conditionScope, cumulativeFalseFacts);
|
|
34373
34381
|
const condition = this.toBool(
|
|
34374
|
-
this.resolveExpression(branch.cond,
|
|
34382
|
+
this.resolveExpression(branch.cond, conditionScope),
|
|
34375
34383
|
branch.cond.pos
|
|
34376
34384
|
);
|
|
34377
34385
|
const child = new Scope(scope);
|
|
34378
34386
|
const branchFacts = [
|
|
34379
34387
|
...cumulativeFalseFacts,
|
|
34380
|
-
...this.conditionFacts(branch.cond,
|
|
34388
|
+
...this.conditionFacts(branch.cond, conditionScope, true)
|
|
34381
34389
|
];
|
|
34382
34390
|
this.applyFactsToScope(child, branchFacts);
|
|
34383
34391
|
const instructions = this.resolveStatements(branch.body, child);
|
|
34384
34392
|
if (!instructionsTerminate(instructions)) {
|
|
34385
34393
|
branchExitFacts.push(branchFacts);
|
|
34386
|
-
branchExitNarrowings.push(
|
|
34394
|
+
branchExitNarrowings.push(child.effectiveNarrowedPaths());
|
|
34387
34395
|
branchExitOwnershipScopes.push(child);
|
|
34388
34396
|
}
|
|
34389
34397
|
cumulativeFalseFacts.push(
|
|
34390
|
-
...this.conditionFacts(branch.cond,
|
|
34398
|
+
...this.conditionFacts(branch.cond, conditionScope, false)
|
|
34391
34399
|
);
|
|
34392
34400
|
return {
|
|
34393
34401
|
expression: pointerToBooleanExpression(condition.pointer),
|
|
@@ -34401,14 +34409,14 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
|
|
|
34401
34409
|
otherwise = this.resolveStatements(statement.elseBody, elseScope);
|
|
34402
34410
|
if (!instructionsTerminate(otherwise)) {
|
|
34403
34411
|
branchExitFacts.push([...cumulativeFalseFacts]);
|
|
34404
|
-
branchExitNarrowings.push(
|
|
34412
|
+
branchExitNarrowings.push(elseScope.effectiveNarrowedPaths());
|
|
34405
34413
|
branchExitOwnershipScopes.push(elseScope);
|
|
34406
34414
|
}
|
|
34407
34415
|
} else {
|
|
34408
34416
|
const noBranchScope = new Scope(scope);
|
|
34409
34417
|
this.applyFactsToScope(noBranchScope, cumulativeFalseFacts);
|
|
34410
34418
|
branchExitFacts.push([...cumulativeFalseFacts]);
|
|
34411
|
-
branchExitNarrowings.push(
|
|
34419
|
+
branchExitNarrowings.push(noBranchScope.effectiveNarrowedPaths());
|
|
34412
34420
|
branchExitOwnershipScopes.push(noBranchScope);
|
|
34413
34421
|
}
|
|
34414
34422
|
mergeBranchInvalidations(scope, branchExitOwnershipScopes);
|
|
@@ -34642,12 +34650,15 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
|
|
|
34642
34650
|
statement.body,
|
|
34643
34651
|
conditionLocals
|
|
34644
34652
|
);
|
|
34645
|
-
|
|
34646
|
-
|
|
34647
|
-
|
|
34648
|
-
|
|
34649
|
-
|
|
34650
|
-
|
|
34653
|
+
const bodyFlow = statementFlow(statement.body, /* @__PURE__ */ new WeakMap());
|
|
34654
|
+
if (bodyFlow.has("fallthrough") || bodyFlow.has("continue")) {
|
|
34655
|
+
this.invalidateLoopEntryNarrowingsAssignedBy(
|
|
34656
|
+
loopEntryScope,
|
|
34657
|
+
loopScope,
|
|
34658
|
+
[statement.iterator],
|
|
34659
|
+
conditionLocals
|
|
34660
|
+
);
|
|
34661
|
+
}
|
|
34651
34662
|
const condition = this.toBool(
|
|
34652
34663
|
this.resolveExpression(statement.condition, loopEntryScope),
|
|
34653
34664
|
statement.condition.pos
|
|
@@ -35514,13 +35525,13 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
|
|
|
35514
35525
|
if (assignedPath) {
|
|
35515
35526
|
const rootEntry = scope.lookup(pathRoot(assignedPath));
|
|
35516
35527
|
if (rootEntry) {
|
|
35517
|
-
const
|
|
35528
|
+
const retainedFacts = unaffectedNarrowings(
|
|
35518
35529
|
assignedPath,
|
|
35519
35530
|
rootEntry,
|
|
35520
35531
|
scope
|
|
35521
35532
|
);
|
|
35522
35533
|
scope.invalidate(rootEntry);
|
|
35523
|
-
for (const [path, type] of
|
|
35534
|
+
for (const [path, type] of retainedFacts) {
|
|
35524
35535
|
scope.narrow(path, rootEntry, type);
|
|
35525
35536
|
}
|
|
35526
35537
|
if (statement.op === "=" && !isNullable(value.type)) {
|
|
@@ -35737,13 +35748,13 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
|
|
|
35737
35748
|
if (assignedPath) {
|
|
35738
35749
|
const rootEntry = scope.lookup(pathRoot(assignedPath));
|
|
35739
35750
|
if (rootEntry) {
|
|
35740
|
-
const
|
|
35751
|
+
const retainedFacts = unaffectedNarrowings(
|
|
35741
35752
|
assignedPath,
|
|
35742
35753
|
rootEntry,
|
|
35743
35754
|
scope
|
|
35744
35755
|
);
|
|
35745
35756
|
scope.invalidate(rootEntry);
|
|
35746
|
-
for (const [path, type] of
|
|
35757
|
+
for (const [path, type] of retainedFacts) {
|
|
35747
35758
|
scope.narrow(path, rootEntry, type);
|
|
35748
35759
|
}
|
|
35749
35760
|
}
|
|
@@ -36358,18 +36369,19 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
|
|
|
36358
36369
|
case "coalesce": {
|
|
36359
36370
|
const left = this.resolveExpression(expression.left, scope);
|
|
36360
36371
|
const leftOptional = { ...left.type, nullable: true };
|
|
36372
|
+
const nullLeft = isNull(left.type);
|
|
36361
36373
|
const right = this.resolveExpression(
|
|
36362
36374
|
expression.right,
|
|
36363
36375
|
scope,
|
|
36364
|
-
leftOptional
|
|
36376
|
+
nullLeft ? expected : leftOptional
|
|
36365
36377
|
);
|
|
36366
|
-
if (!isNeoScriptTypeAssignable(right.type, leftOptional, this.project)) {
|
|
36378
|
+
if (!nullLeft && !isNeoScriptTypeAssignable(right.type, leftOptional, this.project)) {
|
|
36367
36379
|
throw new CompileError(
|
|
36368
36380
|
`\`??\` right operand ${this.describe(right.type)} is not assignable to ${this.describe(leftOptional)}`,
|
|
36369
36381
|
expression.pos
|
|
36370
36382
|
);
|
|
36371
36383
|
}
|
|
36372
|
-
const resultType = {
|
|
36384
|
+
const resultType = nullLeft ? right.type : {
|
|
36373
36385
|
...left.type,
|
|
36374
36386
|
nullable: isNullable(left.type) && isNullable(right.type)
|
|
36375
36387
|
};
|
|
@@ -37070,20 +37082,25 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
|
|
|
37070
37082
|
return whenTrue ? factsWhenTrue(expression, pathOf) : factsWhenFalse(expression, pathOf);
|
|
37071
37083
|
}
|
|
37072
37084
|
/**
|
|
37073
|
-
* A loop body is resolved once but can execute repeatedly.
|
|
37074
|
-
*
|
|
37075
|
-
*
|
|
37076
|
-
* shared iteration so only the loop's own condition can narrow them again.
|
|
37085
|
+
* A loop body is resolved once but can execute repeatedly. Hide facts about
|
|
37086
|
+
* paths it may replace before resolving the shared iteration; unrelated facts
|
|
37087
|
+
* still hold, and the loop condition can narrow the written paths again.
|
|
37077
37088
|
*/
|
|
37078
37089
|
invalidateLoopEntryNarrowingsAssignedBy(loopEntryScope, outerScope, statements, locals = /* @__PURE__ */ new Set()) {
|
|
37079
|
-
for (const
|
|
37090
|
+
for (const assignedPath of collectAssignedPaths(
|
|
37080
37091
|
statements,
|
|
37081
37092
|
/* @__PURE__ */ new Set(),
|
|
37082
37093
|
locals
|
|
37083
37094
|
)) {
|
|
37084
|
-
const path = this.narrowingPath(
|
|
37095
|
+
const path = this.narrowingPath(assignedPath, outerScope);
|
|
37085
37096
|
const outerEntry = path === null ? null : outerScope.lookup(pathRoot(path));
|
|
37086
|
-
if (outerEntry)
|
|
37097
|
+
if (outerEntry && path !== null) {
|
|
37098
|
+
const retained = unaffectedNarrowings(path, outerEntry, loopEntryScope);
|
|
37099
|
+
loopEntryScope.hideInheritedNarrowing(outerEntry);
|
|
37100
|
+
for (const [retainedPath, type] of retained) {
|
|
37101
|
+
loopEntryScope.narrow(retainedPath, outerEntry, type);
|
|
37102
|
+
}
|
|
37103
|
+
}
|
|
37087
37104
|
}
|
|
37088
37105
|
}
|
|
37089
37106
|
applyFactsToScope(targetScope, facts, mode = "all") {
|
|
@@ -38520,6 +38537,7 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
|
|
|
38520
38537
|
(candidate) => (candidate.kind === "function" || candidate.kind === "method") && candidate.name === callee.name
|
|
38521
38538
|
);
|
|
38522
38539
|
if (member) {
|
|
38540
|
+
this.validateFunctionReceiver(receiver, callee.name, optional2, pos);
|
|
38523
38541
|
if (type !== void 0) this.assertMemberAccessible(type, member, pos);
|
|
38524
38542
|
if (member.static === true) {
|
|
38525
38543
|
throw new CompileError(
|
|
@@ -39668,12 +39686,10 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
|
|
|
39668
39686
|
callableSignatureForReceiver(symbol, receiver) {
|
|
39669
39687
|
let parameters = symbol.parameters ?? [];
|
|
39670
39688
|
let returnType = symbol.returnType ?? symbol.type;
|
|
39671
|
-
if (this.context.projectSourceKind !== "spec" && !(receiver?.kind === "instance" && receiver.dispatch === "base")) {
|
|
39672
|
-
return { parameters, returnType };
|
|
39673
|
-
}
|
|
39674
39689
|
if (receiver?.kind !== "instance") return { parameters, returnType };
|
|
39675
39690
|
const receiverType = receiver.expression.type;
|
|
39676
39691
|
if (receiverType.kind !== "named") return { parameters, returnType };
|
|
39692
|
+
if (!receiverType.typeArguments?.length) return { parameters, returnType };
|
|
39677
39693
|
const declaring = this.project.typeById.get(receiverType.typeId);
|
|
39678
39694
|
if (declaring === void 0) return { parameters, returnType };
|
|
39679
39695
|
parameters = parameters.map((parameter3) => ({
|
|
@@ -40577,6 +40593,21 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
|
|
|
40577
40593
|
callSiteId: this.nextCallSite(expression.pos)
|
|
40578
40594
|
};
|
|
40579
40595
|
}
|
|
40596
|
+
validateFunctionReceiver(receiver, name, optional2, pos) {
|
|
40597
|
+
if (optional2 && !isNullable(receiver.type)) {
|
|
40598
|
+
throw new CompileError(
|
|
40599
|
+
`\`?.\` requires an optional receiver; got ${this.describe(receiver.type)}`,
|
|
40600
|
+
pos
|
|
40601
|
+
);
|
|
40602
|
+
}
|
|
40603
|
+
const receiverType = receiver.optionalChainType ?? receiver.type;
|
|
40604
|
+
if (!optional2 && isNullable(receiverType)) {
|
|
40605
|
+
throw new CompileError(
|
|
40606
|
+
`Function '${name}' is called on ${this.describe(receiverType)}, which may be null. Use optional chaining, force-unwrapping, or a null check before calling it.`,
|
|
40607
|
+
pos
|
|
40608
|
+
);
|
|
40609
|
+
}
|
|
40610
|
+
}
|
|
40580
40611
|
resolveFunctionStatement(expression, scope) {
|
|
40581
40612
|
if (expression.kind !== "call") return null;
|
|
40582
40613
|
const receiverValue = this.callReceiver(expression.callee, scope);
|
|
@@ -40740,12 +40771,19 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
|
|
|
40740
40771
|
}
|
|
40741
40772
|
}
|
|
40742
40773
|
const receiver = receiverValue();
|
|
40743
|
-
|
|
40744
|
-
|
|
40774
|
+
const memberReceiverType = neoScriptMemberLookupType(receiver.type);
|
|
40775
|
+
if (memberReceiverType.kind !== "named") return null;
|
|
40776
|
+
const type = this.project.typeById.get(memberReceiverType.typeId);
|
|
40745
40777
|
const symbol = type?.members.find(
|
|
40746
40778
|
(candidate) => (candidate.kind === "function" || candidate.kind === "method") && candidate.name === memberName
|
|
40747
40779
|
);
|
|
40748
40780
|
if (!symbol) return null;
|
|
40781
|
+
this.validateFunctionReceiver(
|
|
40782
|
+
receiver,
|
|
40783
|
+
memberName,
|
|
40784
|
+
expression.callee.optional === true,
|
|
40785
|
+
expression.pos
|
|
40786
|
+
);
|
|
40749
40787
|
if (type !== void 0) {
|
|
40750
40788
|
this.assertMemberAccessible(type, symbol, expression.pos);
|
|
40751
40789
|
}
|
|
@@ -40758,7 +40796,10 @@ var StrictNeoScriptResolver = class _StrictNeoScriptResolver {
|
|
|
40758
40796
|
this.validateCallableInContext(symbol, expression.pos);
|
|
40759
40797
|
const resolved = this.resolveCallableArguments(
|
|
40760
40798
|
symbol,
|
|
40761
|
-
{
|
|
40799
|
+
{
|
|
40800
|
+
kind: "instance",
|
|
40801
|
+
expression: memberReceiverType === receiver.type ? receiver : { ...receiver, type: memberReceiverType }
|
|
40802
|
+
},
|
|
40762
40803
|
expression.args,
|
|
40763
40804
|
scope,
|
|
40764
40805
|
expression.pos
|
|
@@ -41479,12 +41520,18 @@ function identPathSegments(expression) {
|
|
|
41479
41520
|
if (receiver === null) return null;
|
|
41480
41521
|
return [...receiver, expression.name];
|
|
41481
41522
|
}
|
|
41482
|
-
function
|
|
41523
|
+
function unaffectedNarrowings(path, rootEntry, scope) {
|
|
41483
41524
|
const facts = [];
|
|
41484
|
-
|
|
41485
|
-
|
|
41486
|
-
|
|
41487
|
-
|
|
41525
|
+
const prefix = `${path}.`;
|
|
41526
|
+
const dot = path.lastIndexOf(".");
|
|
41527
|
+
if (dot === -1) return facts;
|
|
41528
|
+
const member = path.slice(dot);
|
|
41529
|
+
for (const [candidate, narrowed] of scope.effectiveNarrowedPaths()) {
|
|
41530
|
+
if (narrowed.rootEntry !== rootEntry) continue;
|
|
41531
|
+
if (candidate === path || candidate.startsWith(prefix)) continue;
|
|
41532
|
+
if (candidate.endsWith(member) || candidate.includes(`${member}.`))
|
|
41533
|
+
continue;
|
|
41534
|
+
facts.push([candidate, narrowed.type]);
|
|
41488
41535
|
}
|
|
41489
41536
|
return facts;
|
|
41490
41537
|
}
|
|
@@ -41808,22 +41855,22 @@ function localsWithBindings(locals, expression, whenTrue) {
|
|
|
41808
41855
|
...facts.flatMap((fact) => fact.bindingName ? [fact.bindingName] : [])
|
|
41809
41856
|
]);
|
|
41810
41857
|
}
|
|
41811
|
-
function
|
|
41858
|
+
function collectAssignedPaths(statements, roots = /* @__PURE__ */ new Set(), inheritedLocals = /* @__PURE__ */ new Set(), flowCache = /* @__PURE__ */ new WeakMap()) {
|
|
41812
41859
|
const locals = new Set(inheritedLocals);
|
|
41813
41860
|
for (const statement of statements) {
|
|
41814
41861
|
if (statement.kind === "assign") {
|
|
41815
41862
|
const assignedPath = canonicalPath(statement.target);
|
|
41816
41863
|
if (assignedPath && !locals.has(pathRoot(assignedPath))) {
|
|
41817
|
-
roots.add(
|
|
41864
|
+
roots.add(assignedPath);
|
|
41818
41865
|
}
|
|
41819
|
-
|
|
41866
|
+
collectAssignedPathsInExpression(
|
|
41820
41867
|
statement.target,
|
|
41821
41868
|
roots,
|
|
41822
41869
|
locals,
|
|
41823
41870
|
flowCache
|
|
41824
41871
|
);
|
|
41825
41872
|
if (statement.value)
|
|
41826
|
-
|
|
41873
|
+
collectAssignedPathsInExpression(
|
|
41827
41874
|
statement.value,
|
|
41828
41875
|
roots,
|
|
41829
41876
|
locals,
|
|
@@ -41832,7 +41879,7 @@ function collectAssignedPathRoots(statements, roots = /* @__PURE__ */ new Set(),
|
|
|
41832
41879
|
continue;
|
|
41833
41880
|
}
|
|
41834
41881
|
if (statement.kind === "varDecl") {
|
|
41835
|
-
|
|
41882
|
+
collectAssignedPathsInExpression(
|
|
41836
41883
|
statement.init,
|
|
41837
41884
|
roots,
|
|
41838
41885
|
locals,
|
|
@@ -41846,7 +41893,7 @@ function collectAssignedPathRoots(statements, roots = /* @__PURE__ */ new Set(),
|
|
|
41846
41893
|
const falseFacts = [];
|
|
41847
41894
|
const fallthroughFacts = [];
|
|
41848
41895
|
for (const branch of statement.branches) {
|
|
41849
|
-
|
|
41896
|
+
collectAssignedPathsInExpression(
|
|
41850
41897
|
branch.cond,
|
|
41851
41898
|
roots,
|
|
41852
41899
|
falseLocals,
|
|
@@ -41856,7 +41903,7 @@ function collectAssignedPathRoots(statements, roots = /* @__PURE__ */ new Set(),
|
|
|
41856
41903
|
...falseFacts,
|
|
41857
41904
|
...factsWhenTrue(branch.cond, canonicalPath)
|
|
41858
41905
|
];
|
|
41859
|
-
|
|
41906
|
+
collectAssignedPaths(
|
|
41860
41907
|
branch.body,
|
|
41861
41908
|
roots,
|
|
41862
41909
|
localsWithBindings(falseLocals, branch.cond, true),
|
|
@@ -41868,12 +41915,7 @@ function collectAssignedPathRoots(statements, roots = /* @__PURE__ */ new Set(),
|
|
|
41868
41915
|
falseLocals = localsWithBindings(falseLocals, branch.cond, false);
|
|
41869
41916
|
}
|
|
41870
41917
|
if (statement.elseBody) {
|
|
41871
|
-
|
|
41872
|
-
statement.elseBody,
|
|
41873
|
-
roots,
|
|
41874
|
-
falseLocals,
|
|
41875
|
-
flowCache
|
|
41876
|
-
);
|
|
41918
|
+
collectAssignedPaths(statement.elseBody, roots, falseLocals, flowCache);
|
|
41877
41919
|
if (statementFlow(statement.elseBody, flowCache).has("fallthrough"))
|
|
41878
41920
|
fallthroughFacts.push(falseFacts);
|
|
41879
41921
|
} else {
|
|
@@ -41885,18 +41927,18 @@ function collectAssignedPathRoots(statements, roots = /* @__PURE__ */ new Set(),
|
|
|
41885
41927
|
continue;
|
|
41886
41928
|
}
|
|
41887
41929
|
if (statement.kind === "try") {
|
|
41888
|
-
|
|
41930
|
+
collectAssignedPaths(statement.body, roots, locals, flowCache);
|
|
41889
41931
|
for (const clause of statement.catches) {
|
|
41890
41932
|
const catchLocals = /* @__PURE__ */ new Set([...locals, clause.name]);
|
|
41891
41933
|
if (clause.filter) {
|
|
41892
|
-
|
|
41934
|
+
collectAssignedPathsInExpression(
|
|
41893
41935
|
clause.filter,
|
|
41894
41936
|
roots,
|
|
41895
41937
|
catchLocals,
|
|
41896
41938
|
flowCache
|
|
41897
41939
|
);
|
|
41898
41940
|
}
|
|
41899
|
-
|
|
41941
|
+
collectAssignedPaths(
|
|
41900
41942
|
clause.body,
|
|
41901
41943
|
roots,
|
|
41902
41944
|
clause.filter ? localsWithBindings(catchLocals, clause.filter, true) : catchLocals,
|
|
@@ -41906,13 +41948,13 @@ function collectAssignedPathRoots(statements, roots = /* @__PURE__ */ new Set(),
|
|
|
41906
41948
|
continue;
|
|
41907
41949
|
}
|
|
41908
41950
|
if (statement.kind === "while" || statement.kind === "doWhile") {
|
|
41909
|
-
|
|
41951
|
+
collectAssignedPathsInExpression(
|
|
41910
41952
|
statement.condition,
|
|
41911
41953
|
roots,
|
|
41912
41954
|
locals,
|
|
41913
41955
|
flowCache
|
|
41914
41956
|
);
|
|
41915
|
-
|
|
41957
|
+
collectAssignedPaths(
|
|
41916
41958
|
statement.body,
|
|
41917
41959
|
roots,
|
|
41918
41960
|
statement.kind === "while" ? localsWithBindings(locals, statement.condition, true) : locals,
|
|
@@ -41921,14 +41963,14 @@ function collectAssignedPathRoots(statements, roots = /* @__PURE__ */ new Set(),
|
|
|
41921
41963
|
continue;
|
|
41922
41964
|
}
|
|
41923
41965
|
if (statement.kind === "for") {
|
|
41924
|
-
|
|
41966
|
+
collectAssignedPathsInExpression(
|
|
41925
41967
|
statement.initializer.init,
|
|
41926
41968
|
roots,
|
|
41927
41969
|
locals,
|
|
41928
41970
|
flowCache
|
|
41929
41971
|
);
|
|
41930
41972
|
const loopLocals = /* @__PURE__ */ new Set([...locals, statement.initializer.name]);
|
|
41931
|
-
|
|
41973
|
+
collectAssignedPathsInExpression(
|
|
41932
41974
|
statement.condition,
|
|
41933
41975
|
roots,
|
|
41934
41976
|
loopLocals,
|
|
@@ -41939,22 +41981,17 @@ function collectAssignedPathRoots(statements, roots = /* @__PURE__ */ new Set(),
|
|
|
41939
41981
|
statement.condition,
|
|
41940
41982
|
true
|
|
41941
41983
|
);
|
|
41942
|
-
|
|
41984
|
+
collectAssignedPaths(
|
|
41943
41985
|
[statement.iterator],
|
|
41944
41986
|
roots,
|
|
41945
41987
|
iterationLocals,
|
|
41946
41988
|
flowCache
|
|
41947
41989
|
);
|
|
41948
|
-
|
|
41949
|
-
statement.body,
|
|
41950
|
-
roots,
|
|
41951
|
-
iterationLocals,
|
|
41952
|
-
flowCache
|
|
41953
|
-
);
|
|
41990
|
+
collectAssignedPaths(statement.body, roots, iterationLocals, flowCache);
|
|
41954
41991
|
continue;
|
|
41955
41992
|
}
|
|
41956
41993
|
if (statement.kind === "forEach") {
|
|
41957
|
-
|
|
41994
|
+
collectAssignedPathsInExpression(
|
|
41958
41995
|
statement.collection,
|
|
41959
41996
|
roots,
|
|
41960
41997
|
locals,
|
|
@@ -41962,11 +41999,11 @@ function collectAssignedPathRoots(statements, roots = /* @__PURE__ */ new Set(),
|
|
|
41962
41999
|
);
|
|
41963
42000
|
const loopLocals = /* @__PURE__ */ new Set([...locals, statement.name]);
|
|
41964
42001
|
if (statement.key) loopLocals.add(statement.key.name);
|
|
41965
|
-
|
|
42002
|
+
collectAssignedPaths(statement.body, roots, loopLocals, flowCache);
|
|
41966
42003
|
continue;
|
|
41967
42004
|
}
|
|
41968
42005
|
if (statement.kind === "switch") {
|
|
41969
|
-
|
|
42006
|
+
collectAssignedPathsInExpression(
|
|
41970
42007
|
statement.selector,
|
|
41971
42008
|
roots,
|
|
41972
42009
|
locals,
|
|
@@ -41975,7 +42012,7 @@ function collectAssignedPathRoots(statements, roots = /* @__PURE__ */ new Set(),
|
|
|
41975
42012
|
for (const section of statement.sections) {
|
|
41976
42013
|
for (const label of section.labels) {
|
|
41977
42014
|
if (label.kind === "case") {
|
|
41978
|
-
|
|
42015
|
+
collectAssignedPathsInExpression(
|
|
41979
42016
|
label.expression,
|
|
41980
42017
|
roots,
|
|
41981
42018
|
locals,
|
|
@@ -41983,13 +42020,13 @@ function collectAssignedPathRoots(statements, roots = /* @__PURE__ */ new Set(),
|
|
|
41983
42020
|
);
|
|
41984
42021
|
}
|
|
41985
42022
|
}
|
|
41986
|
-
|
|
42023
|
+
collectAssignedPaths(section.body, roots, locals, flowCache);
|
|
41987
42024
|
}
|
|
41988
42025
|
continue;
|
|
41989
42026
|
}
|
|
41990
42027
|
if (statement.kind === "return" || statement.kind === "throw") {
|
|
41991
42028
|
if (statement.expr)
|
|
41992
|
-
|
|
42029
|
+
collectAssignedPathsInExpression(
|
|
41993
42030
|
statement.expr,
|
|
41994
42031
|
roots,
|
|
41995
42032
|
locals,
|
|
@@ -41998,7 +42035,7 @@ function collectAssignedPathRoots(statements, roots = /* @__PURE__ */ new Set(),
|
|
|
41998
42035
|
continue;
|
|
41999
42036
|
}
|
|
42000
42037
|
if (statement.kind === "exprStmt") {
|
|
42001
|
-
|
|
42038
|
+
collectAssignedPathsInExpression(
|
|
42002
42039
|
statement.expr,
|
|
42003
42040
|
roots,
|
|
42004
42041
|
locals,
|
|
@@ -42008,43 +42045,28 @@ function collectAssignedPathRoots(statements, roots = /* @__PURE__ */ new Set(),
|
|
|
42008
42045
|
}
|
|
42009
42046
|
return roots;
|
|
42010
42047
|
}
|
|
42011
|
-
function
|
|
42048
|
+
function collectAssignedPathsInExpression(expression, roots, locals, flowCache) {
|
|
42012
42049
|
switch (expression.kind) {
|
|
42013
42050
|
case "litInterp":
|
|
42014
42051
|
for (const part of expression.parts) {
|
|
42015
42052
|
if (part.kind === "expr") {
|
|
42016
|
-
|
|
42017
|
-
part.expr,
|
|
42018
|
-
roots,
|
|
42019
|
-
locals,
|
|
42020
|
-
flowCache
|
|
42021
|
-
);
|
|
42053
|
+
collectAssignedPathsInExpression(part.expr, roots, locals, flowCache);
|
|
42022
42054
|
}
|
|
42023
42055
|
}
|
|
42024
42056
|
return;
|
|
42025
42057
|
case "litList":
|
|
42026
42058
|
for (const element of expression.elements) {
|
|
42027
|
-
|
|
42059
|
+
collectAssignedPathsInExpression(element, roots, locals, flowCache);
|
|
42028
42060
|
}
|
|
42029
42061
|
return;
|
|
42030
42062
|
case "litDict":
|
|
42031
42063
|
for (const entry of expression.entries) {
|
|
42032
|
-
|
|
42033
|
-
|
|
42034
|
-
roots,
|
|
42035
|
-
locals,
|
|
42036
|
-
flowCache
|
|
42037
|
-
);
|
|
42038
|
-
collectAssignedPathRootsInExpression(
|
|
42039
|
-
entry.value,
|
|
42040
|
-
roots,
|
|
42041
|
-
locals,
|
|
42042
|
-
flowCache
|
|
42043
|
-
);
|
|
42064
|
+
collectAssignedPathsInExpression(entry.key, roots, locals, flowCache);
|
|
42065
|
+
collectAssignedPathsInExpression(entry.value, roots, locals, flowCache);
|
|
42044
42066
|
}
|
|
42045
42067
|
return;
|
|
42046
42068
|
case "member":
|
|
42047
|
-
|
|
42069
|
+
collectAssignedPathsInExpression(
|
|
42048
42070
|
expression.receiver,
|
|
42049
42071
|
roots,
|
|
42050
42072
|
locals,
|
|
@@ -42052,13 +42074,13 @@ function collectAssignedPathRootsInExpression(expression, roots, locals, flowCac
|
|
|
42052
42074
|
);
|
|
42053
42075
|
return;
|
|
42054
42076
|
case "index":
|
|
42055
|
-
|
|
42077
|
+
collectAssignedPathsInExpression(
|
|
42056
42078
|
expression.receiver,
|
|
42057
42079
|
roots,
|
|
42058
42080
|
locals,
|
|
42059
42081
|
flowCache
|
|
42060
42082
|
);
|
|
42061
|
-
|
|
42083
|
+
collectAssignedPathsInExpression(
|
|
42062
42084
|
expression.index,
|
|
42063
42085
|
roots,
|
|
42064
42086
|
locals,
|
|
@@ -42066,32 +42088,22 @@ function collectAssignedPathRootsInExpression(expression, roots, locals, flowCac
|
|
|
42066
42088
|
);
|
|
42067
42089
|
return;
|
|
42068
42090
|
case "call":
|
|
42069
|
-
|
|
42091
|
+
collectAssignedPathsInExpression(
|
|
42070
42092
|
expression.callee,
|
|
42071
42093
|
roots,
|
|
42072
42094
|
locals,
|
|
42073
42095
|
flowCache
|
|
42074
42096
|
);
|
|
42075
42097
|
for (const argument2 of expression.args) {
|
|
42076
|
-
|
|
42077
|
-
argument2,
|
|
42078
|
-
roots,
|
|
42079
|
-
locals,
|
|
42080
|
-
flowCache
|
|
42081
|
-
);
|
|
42098
|
+
collectAssignedPathsInExpression(argument2, roots, locals, flowCache);
|
|
42082
42099
|
}
|
|
42083
42100
|
return;
|
|
42084
42101
|
case "new":
|
|
42085
42102
|
for (const argument2 of expression.args) {
|
|
42086
|
-
|
|
42087
|
-
argument2,
|
|
42088
|
-
roots,
|
|
42089
|
-
locals,
|
|
42090
|
-
flowCache
|
|
42091
|
-
);
|
|
42103
|
+
collectAssignedPathsInExpression(argument2, roots, locals, flowCache);
|
|
42092
42104
|
}
|
|
42093
42105
|
for (const initializer of expression.initializer ?? []) {
|
|
42094
|
-
|
|
42106
|
+
collectAssignedPathsInExpression(
|
|
42095
42107
|
initializer.value,
|
|
42096
42108
|
roots,
|
|
42097
42109
|
locals,
|
|
@@ -42102,15 +42114,10 @@ function collectAssignedPathRootsInExpression(expression, roots, locals, flowCac
|
|
|
42102
42114
|
case "annotated":
|
|
42103
42115
|
for (const annotation2 of expression.annotations) {
|
|
42104
42116
|
for (const argument2 of annotation2.args) {
|
|
42105
|
-
|
|
42106
|
-
argument2,
|
|
42107
|
-
roots,
|
|
42108
|
-
locals,
|
|
42109
|
-
flowCache
|
|
42110
|
-
);
|
|
42117
|
+
collectAssignedPathsInExpression(argument2, roots, locals, flowCache);
|
|
42111
42118
|
}
|
|
42112
42119
|
}
|
|
42113
|
-
|
|
42120
|
+
collectAssignedPathsInExpression(
|
|
42114
42121
|
expression.expression,
|
|
42115
42122
|
roots,
|
|
42116
42123
|
locals,
|
|
@@ -42119,13 +42126,13 @@ function collectAssignedPathRootsInExpression(expression, roots, locals, flowCac
|
|
|
42119
42126
|
return;
|
|
42120
42127
|
case "binary":
|
|
42121
42128
|
case "coalesce":
|
|
42122
|
-
|
|
42129
|
+
collectAssignedPathsInExpression(
|
|
42123
42130
|
expression.left,
|
|
42124
42131
|
roots,
|
|
42125
42132
|
locals,
|
|
42126
42133
|
flowCache
|
|
42127
42134
|
);
|
|
42128
|
-
|
|
42135
|
+
collectAssignedPathsInExpression(
|
|
42129
42136
|
expression.right,
|
|
42130
42137
|
roots,
|
|
42131
42138
|
locals,
|
|
@@ -42133,19 +42140,19 @@ function collectAssignedPathRootsInExpression(expression, roots, locals, flowCac
|
|
|
42133
42140
|
);
|
|
42134
42141
|
return;
|
|
42135
42142
|
case "conditional":
|
|
42136
|
-
|
|
42143
|
+
collectAssignedPathsInExpression(
|
|
42137
42144
|
expression.condition,
|
|
42138
42145
|
roots,
|
|
42139
42146
|
locals,
|
|
42140
42147
|
flowCache
|
|
42141
42148
|
);
|
|
42142
|
-
|
|
42149
|
+
collectAssignedPathsInExpression(
|
|
42143
42150
|
expression.whenTrue,
|
|
42144
42151
|
roots,
|
|
42145
42152
|
locals,
|
|
42146
42153
|
flowCache
|
|
42147
42154
|
);
|
|
42148
|
-
|
|
42155
|
+
collectAssignedPathsInExpression(
|
|
42149
42156
|
expression.whenFalse,
|
|
42150
42157
|
roots,
|
|
42151
42158
|
locals,
|
|
@@ -42154,7 +42161,7 @@ function collectAssignedPathRootsInExpression(expression, roots, locals, flowCac
|
|
|
42154
42161
|
return;
|
|
42155
42162
|
case "unary":
|
|
42156
42163
|
case "force":
|
|
42157
|
-
|
|
42164
|
+
collectAssignedPathsInExpression(
|
|
42158
42165
|
expression.operand,
|
|
42159
42166
|
roots,
|
|
42160
42167
|
locals,
|
|
@@ -42162,7 +42169,7 @@ function collectAssignedPathRootsInExpression(expression, roots, locals, flowCac
|
|
|
42162
42169
|
);
|
|
42163
42170
|
return;
|
|
42164
42171
|
case "is":
|
|
42165
|
-
|
|
42172
|
+
collectAssignedPathsInExpression(
|
|
42166
42173
|
expression.operand,
|
|
42167
42174
|
roots,
|
|
42168
42175
|
locals,
|
|
@@ -42170,7 +42177,7 @@ function collectAssignedPathRootsInExpression(expression, roots, locals, flowCac
|
|
|
42170
42177
|
);
|
|
42171
42178
|
return;
|
|
42172
42179
|
case "lambda":
|
|
42173
|
-
|
|
42180
|
+
collectAssignedPaths(
|
|
42174
42181
|
expression.body,
|
|
42175
42182
|
roots,
|
|
42176
42183
|
/* @__PURE__ */ new Set([
|
|
@@ -54634,7 +54641,7 @@ var SPECIALIZED_RELATION_KINDS = /* @__PURE__ */ new Set([
|
|
|
54634
54641
|
|
|
54635
54642
|
// ../packages/manifest/schema-contract/registry.mjs
|
|
54636
54643
|
var PROJECT_SCHEMA_CONTRACT = Object.freeze({
|
|
54637
|
-
cliVersion: "0.72.
|
|
54644
|
+
cliVersion: "0.72.4",
|
|
54638
54645
|
projectFileUploadBatchSize: 32,
|
|
54639
54646
|
documentRecords: {
|
|
54640
54647
|
member: {
|