dillon1000/react

Commit

Generalize #1521 for PropertyLoad

This is a more general version of the change from #1521. That PR ensured that 
LoadLocal temporaries accessed outside the instruction's scope are correctly 
promoted. However, we have a similar pattern with PropertyLoad. 

This PR adds a general mechanism for handling these type of indirections: any 
LoadLocal/PropertyLoad temporary accessed when it's defining scope is not active 
will be promoted to a declaration of the defining scope. Notably, we do this in 
a way that ensures that the dependencies are preserved, ie that we correctly 
view the operand of LoadLocal/PropertyLoad as a dependency of the current scope.
Browse files
Changed paths7 files
First-parent comparison
M compiler/forget/src/ReactiveScopes/PropagateScopeDependencies.ts ModifiedA compiler/forget/src/__tests__/fixtures/compiler/jsx-member-expression-tag-grouping.expect.md AddedA compiler/forget/src/__tests__/fixtures/compiler/jsx-member-expression-tag-grouping.js AddedA compiler/forget/src/__tests__/fixtures/compiler/temporary-accessed-outside-scope.expect.md AddedA compiler/forget/src/__tests__/fixtures/compiler/temporary-accessed-outside-scope.js AddedR compiler/forget/src/__tests__/fixtures/compiler/reassigned-temporary-accessed-outside-scope.expect.md →compiler/forget/src/__tests__/fixtures/compiler/temporary-property-load-accessed-outside-scope.expect.md RenamedR compiler/forget/src/__tests__/fixtures/compiler/reassigned-temporary-accessed-outside-scope.js →compiler/forget/src/__tests__/fixtures/compiler/temporary-property-load-accessed-outside-scope.js Renamed
Patch

Files changed

Rendering syntax-highlighted changes…