repro-aliased-capture-mutate.js — react Source File
Architecture documentation for repro-aliased-capture-mutate.js, a javascript file in the react codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 89e79572_6e22_9dbd_2f3e_2052a6f012d1["repro-aliased-capture-mutate.js"] 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05["shared-runtime"] 89e79572_6e22_9dbd_2f3e_2052a6f012d1 --> 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05 style 89e79572_6e22_9dbd_2f3e_2052a6f012d1 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
// @flow @enableTransitivelyFreezeFunctionExpressions:false @enableNewMutationAliasingModel
import {setPropertyByKey, Stringify} from 'shared-runtime';
/**
* Variation of bug in `bug-aliased-capture-aliased-mutate`.
* Fixed in the new inference model.
*
* Found differences in evaluator results
* Non-forget (expected):
* (kind: ok)
* <div>{"cb":{"kind":"Function","result":2},"shouldInvokeFns":true}</div>
* <div>{"cb":{"kind":"Function","result":3},"shouldInvokeFns":true}</div>
* Forget:
* (kind: ok)
* <div>{"cb":{"kind":"Function","result":2},"shouldInvokeFns":true}</div>
* <div>{"cb":{"kind":"Function","result":2},"shouldInvokeFns":true}</div>
*/
function useFoo({a}: {a: number, b: number}) {
const arr = [];
const obj = {value: a};
setPropertyByKey(obj, 'arr', arr);
const obj_alias = obj;
const cb = () => obj_alias.arr.length;
for (let i = 0; i < a; i++) {
arr.push(i);
}
return <Stringify cb={cb} shouldInvokeFns={true} />;
}
export const FIXTURE_ENTRYPOINT = {
fn: useFoo,
params: [{a: 2}],
sequentialRenders: [{a: 2}, {a: 3}],
};
Domain
Subdomains
Functions
Dependencies
- shared-runtime
Source
Frequently Asked Questions
What does repro-aliased-capture-mutate.js do?
repro-aliased-capture-mutate.js is a source file in the react codebase, written in javascript. It belongs to the TestingUtilities domain, Fixtures subdomain.
What functions are defined in repro-aliased-capture-mutate.js?
repro-aliased-capture-mutate.js defines 1 function(s): useFoo.
What does repro-aliased-capture-mutate.js depend on?
repro-aliased-capture-mutate.js imports 1 module(s): shared-runtime.
Where is repro-aliased-capture-mutate.js in the architecture?
repro-aliased-capture-mutate.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-aliased-capture-mutate.js (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free