Skip to content

Commit 41b9a68

Browse files
committed
[compiler] PruneNonEscapingScopes understands terminal operands
We weren't treating terminal operands as eligible for memoization in PruneNonEscapingScopes, which meant that they could end up un-memoized. Terminal operands can also be compound ReactiveValues like SequenceExpressions, so part of the fix is to make sure we don't just recurse into compound values but record the full aliasing information we would for top-level instructions. Still WIP, this needs to handle terminals other than for..of. ghstack-source-id: f59837e Pull Request resolved: #33062
1 parent 5dc00d6 commit 41b9a68

File tree

6 files changed

+666
-468
lines changed

6 files changed

+666
-468
lines changed

compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PrintReactiveFunction.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,12 @@ function writeReactiveValue(writer: Writer, value: ReactiveValue): void {
255255
}
256256
}
257257

258+
export function printReactiveTerminal(terminal: ReactiveTerminal): string {
259+
const writer = new Writer();
260+
writeTerminal(writer, terminal);
261+
return writer.complete();
262+
}
263+
258264
function writeTerminal(writer: Writer, terminal: ReactiveTerminal): void {
259265
switch (terminal.kind) {
260266
case 'break': {

0 commit comments

Comments
 (0)