move reassignment-related range adjustments to InferReactiveScopeVariables
move reassignment-related range adjustments to InferReactiveScopeVariables
Joe Savona committed
Feb 23, 2024 at 16:58 UTC
52612819856f9452ae30604806603b34891de959
3 files changed
+16
-1
compiler/packages/babel-plugin-react-forget/src/Inference/InferAliasForPhis.ts
+1
-1
@@ -17,7 +17,7 @@ export function inferAliasForPhis(
17
const isPhiMutatedAfterCreation: boolean =
18
phi.id.mutableRange.end >
19
(block.instructions.at(0)?.id ?? block.terminal.id);
20
- if (isPhiMutatedAfterCreation || func.env.config.enableForest) {
20
+ if (isPhiMutatedAfterCreation) {
21
for (const [, operand] of phi.operands) {
22
aliases.union([phi.id, operand]);
23
}
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/InferReactiveScopeVariables.ts
+13
@@ -251,6 +251,19 @@ export function findDisjointMutableValues(
251
instr.value.lvalue.place.identifier.id
252
);
253
if (declaration !== undefined) {
254
+ declaration.identifier.mutableRange.end = makeInstructionId(
255
+ Math.max(
256
+ declaration.identifier.mutableRange.end,
257
+ instr.value.lvalue.place.identifier.mutableRange.end
258
+ )
259
+ );
260
+ instr.value.lvalue.place.identifier.mutableRange.start =
261
+ makeInstructionId(
262
+ Math.min(
263
+ declaration.identifier.mutableRange.start,
264
+ instr.value.lvalue.place.identifier.mutableRange.start
265
+ )
266
+ );
267
operands.push(declaration.identifier);
268
}
269
}
compiler/packages/sprout/src/SproutTodoFilter.ts
+2
@@ -442,6 +442,8 @@ const skipFilter = new Set([
442
"forest/forest-TasksApp.flow",
443
"forest/forest-overwritten-let-binding-type-annotation.flow",
444
"forest/forest-phi-type-unused-initializer.flow",
445
+ "forest/forest-TaskEditor.flow",
446
+ "forest/forest-TaskTitleField.flow",
447
448
// TODO: we probably want to always skip these
449
"rules-of-hooks/rules-of-hooks-0592bd574811",