@@ -45756,7 +45756,7 @@ class Visitor extends ReactiveFunctionVisitor {
4575645756 this.prunedScopes.add(scopeBlock.scope.id);
4575745757 }
4575845758 visitInstruction(instruction, state) {
45759- var _a, _b, _c ;
45759+ var _a, _b;
4576045760 this.recordTemporaries(instruction, state);
4576145761 const value = instruction.value;
4576245762 if (value.kind === 'StoreLocal' &&
@@ -45774,15 +45774,18 @@ class Visitor extends ReactiveFunctionVisitor {
4577445774 ids.add(value.place.identifier);
4577545775 }
4577645776 if (value.kind === 'StartMemoize') {
45777- let depsFromSource = null;
45778- if (value.deps != null) {
45779- depsFromSource = value.deps;
45780- }
4578145777 CompilerError.invariant(state.manualMemoState == null, {
4578245778 reason: 'Unexpected nested StartMemoize instructions',
4578345779 description: `Bad manual memoization ids: ${(_a = state.manualMemoState) === null || _a === void 0 ? void 0 : _a.manualMemoId}, ${value.manualMemoId}`,
4578445780 loc: value.loc,
4578545781 });
45782+ if (value.hasInvalidDeps === true) {
45783+ return;
45784+ }
45785+ let depsFromSource = null;
45786+ if (value.deps != null) {
45787+ depsFromSource = value.deps;
45788+ }
4578645789 state.manualMemoState = {
4578745790 loc: instruction.loc,
4578845791 decls: new Set(),
@@ -45810,10 +45813,12 @@ class Visitor extends ReactiveFunctionVisitor {
4581045813 }
4581145814 }
4581245815 if (value.kind === 'FinishMemoize') {
45813- CompilerError.invariant(state.manualMemoState != null &&
45814- state.manualMemoState.manualMemoId === value.manualMemoId, {
45816+ if (state.manualMemoState == null) {
45817+ return;
45818+ }
45819+ CompilerError.invariant(state.manualMemoState.manualMemoId === value.manualMemoId, {
4581545820 reason: 'Unexpected mismatch between StartMemoize and FinishMemoize',
45816- description: `Encountered StartMemoize id=${(_b = state.manualMemoState) === null || _b === void 0 ? void 0 : _b .manualMemoId} followed by FinishMemoize id=${value.manualMemoId}`,
45821+ description: `Encountered StartMemoize id=${state.manualMemoState.manualMemoId} followed by FinishMemoize id=${value.manualMemoId}`,
4581745822 loc: value.loc,
4581845823 });
4581945824 const reassignments = state.manualMemoState.reassignments;
@@ -45822,7 +45827,7 @@ class Visitor extends ReactiveFunctionVisitor {
4582245827 for (const { identifier, loc } of eachInstructionValueOperand(value)) {
4582345828 let decls;
4582445829 if (identifier.scope == null) {
45825- decls = (_c = reassignments.get(identifier.declarationId)) !== null && _c !== void 0 ? _c : [identifier];
45830+ decls = (_b = reassignments.get(identifier.declarationId)) !== null && _b !== void 0 ? _b : [identifier];
4582645831 }
4582745832 else {
4582845833 decls = [identifier];
@@ -49358,6 +49363,7 @@ function validateExhaustiveDependencies(fn) {
4935849363 const diagnostic = validateDependencies(inferred, (_a = startMemo.deps) !== null && _a !== void 0 ? _a : [], reactive, startMemo.depsLoc, ErrorCategory.MemoDependencies, 'all');
4935949364 if (diagnostic != null) {
4936049365 fn.env.recordError(diagnostic);
49366+ startMemo.hasInvalidDeps = true;
4936149367 }
4936249368 }
4936349369 dependencies.clear();
0 commit comments