Skip to content

Commit e9db3cc

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: 09a29230514e3bc95d1833cd4392de238fabbeda Pull Request resolved: facebook#33062
1 parent d8074cb commit e9db3cc

6 files changed

+681
-468
lines changed

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

+6
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)