dillon1000/react
Commit
Browse files Fix Array#at and similar cases to capture if receiver is mutable
The previous PR helped me realize we weren't handling Array#at correctly. If the receiver is a mutable value its effect should be Capture and the lvalue effect needs to be Store. This PR updates the definition for Array#at to make the receiver Capture, and then updates inference to automatically set the lvalue effect to Store if _any_ argument (or the receiver) was Capture.
Changed paths4 files
First-parent comparisoncompiler/packages/babel-plugin-react-forget/src/HIR/ObjectShape.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/Inference/InferReferenceEffects.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/array-at-mutate-after-capture.expect.md ModifiedM compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/assignment-variations-complex-lvalue-array.expect.md ModifiedPatch
Files changed
Rendering syntax-highlighted changes…