dillon1000/react

Commit

Fix capturedRefs collection for lambdas

When we calculate the dependencies of a FunctionExpression we were only adding 
new items if the binding identifier had not been seen yet. That is correct for 
`capturedIds` since its the set of identifiers, but incorrect for `capturedRefs` 
since its an array of all the distinct places. This meant that if a function 
expression referenced multiple properties of the same binding, we'd only record 
the first one. We now correctly record all of them.
Browse files
Changed paths6 files
First-parent comparison
M compiler/forget/src/HIR/BuildHIR.ts ModifiedM compiler/forget/src/__tests__/fixtures/compiler/useMemo-if-else-multiple-return.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/compiler/useMemo-independently-memoizeable.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/compiler/useMemo-logical.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/compiler/useMemo-multiple-if-else.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/compiler/useMemo-switch-no-fallthrough.expect.md Modified
Patch

Files changed

Rendering syntax-highlighted changes…