From 7fddf42d060b1c2f75b895ae23744be27200b486 Mon Sep 17 00:00:00 2001 From: Joe Savona Date: Wed, 31 May 2023 16:05:07 -0700 Subject: [PATCH] [ez] Hooks dont escape, their args do --- .../forget/src/ReactiveScopes/PruneNonEscapingScopes.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/forget/src/ReactiveScopes/PruneNonEscapingScopes.ts b/compiler/forget/src/ReactiveScopes/PruneNonEscapingScopes.ts index 18bc3c9104..0e467545c3 100644 --- a/compiler/forget/src/ReactiveScopes/PruneNonEscapingScopes.ts +++ b/compiler/forget/src/ReactiveScopes/PruneNonEscapingScopes.ts @@ -25,7 +25,6 @@ import { getHookKind, isMutableEffect, } from "../HIR"; -import { eachInstructionValueOperand } from "../HIR/visitors"; import { log } from "../Utils/logger"; import { assertExhaustive } from "../Utils/utils"; import { getPlaceScope } from "./BuildReactiveBlocks"; @@ -722,8 +721,9 @@ class CollectDependenciesVisitor extends ReactiveFunctionVisitor { } else if (instruction.value.kind === "CallExpression") { const callee = instruction.value.callee; if (getHookKind(state.env, callee.identifier)) { - for (const operand of eachInstructionValueOperand(instruction.value)) { - state.escapingValues.add(operand.identifier.id); + for (const operand of instruction.value.args) { + const place = operand.kind === "Spread" ? operand.place : operand; + state.escapingValues.add(place.identifier.id); } } }