Changes the logic for determining which ModifiedBindings need serialization to work properly in the face of nested optimized functions. We should only serialize ModifiedBindings if their environment was not created by the optimized function or its children (i.e. the binding should not be local to the optimized function).
This also solves the issue that React components don't have a parent chain which is important for properly handling nested optimized functions. Solves #2550.
Solves #2430, Solves #2426, Solves #2423, Solves #2422 (some were solved by previous PRs, just adding the tests here as well).
Release Notes: None
Changes the logic for determining which ModifiedBindings need serialization to work properly in the face of nested optimized functions. We should only serialize
ModifiedBinding
s if their environment was not created by the optimized function or its children (i.e. the binding should not be local to the optimized function).This also solves the issue that React components don't have a parent chain which is important for properly handling nested optimized functions. Solves #2550.
Solves #2430, Solves #2426, Solves #2423, Solves #2422 (some were solved by previous PRs, just adding the tests here as well).