Skip to content

Commit ba826d6

Browse files
[compiler] Stop relying on identifier mutable ranges after constructing scopes
Addresses discussion at facebook#30399 (comment). Once we've constructed scopes it's invalid to use identifier mutable ranges. The only places we can do this which i can find are ValidateMemoizedEffectDeps (which is already flawed and disabled by default) and ValidatePreservedManualMemoization. I added a todo to the former, and fixed up the latter. The idea of the fix is that for StartMemo dependencies, if they needed to be memoized (identifier.scope != null) then that scope should exist and should have already completed. If they didn't need a scope or can't have one created (eg their range spans a hook), then their scope would be pruned. So if the scope is set, not pruned, and not completed, then it's an error. For declarations (FinishMemo) the existing logic applies unchanged. ghstack-source-id: af5bfd8 Pull Request resolved: facebook#30428
1 parent b943feb commit ba826d6

File tree

1 file changed

+271
-255
lines changed

1 file changed

+271
-255
lines changed

0 commit comments

Comments
 (0)