dillon1000/react
Commit
Browse files MutableIfOperandsAreMutable flag handles mutation via capturing
There was one missing piece to the optimization from the previous PR: Array#map can return an alias to the receiver in its output, which means that mutations of the result have to be treated as mutations of the receiver. This means we need to use a Capture effect on the receiver. If that doesn't get downgraded to a Read bc the value was immutable, we then also need to make the lvalue effect a Store (so that InferMutableRanges actually looks at it for aliasing).
Changed paths3 files
First-parent comparisoncompiler/packages/babel-plugin-react-forget/src/Inference/InferReferenceEffects.ts ModifiedA compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/array-map-mutable-array-non-mutating-lambda-mutated-result.expect.md AddedA compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/array-map-mutable-array-non-mutating-lambda-mutated-result.js AddedPatch
Files changed
Rendering syntax-highlighted changes…