Home / File/ capture-backedge-phi-with-later-mutation.js — react Source File

capture-backedge-phi-with-later-mutation.js — react Source File

Architecture documentation for capture-backedge-phi-with-later-mutation.js, a javascript file in the react codebase. 1 imports, 0 dependents.

File javascript TestingUtilities Fixtures 1 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  c87b742b_82bf_3809_b43e_ad26b8dda254["capture-backedge-phi-with-later-mutation.js"]
  006eec3d_77a9_4a47_e6c1_a96d7a6c9c05["shared-runtime"]
  c87b742b_82bf_3809_b43e_ad26b8dda254 --> 006eec3d_77a9_4a47_e6c1_a96d7a6c9c05
  style c87b742b_82bf_3809_b43e_ad26b8dda254 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// @enableNewMutationAliasingModel
import {arrayPush, Stringify} from 'shared-runtime';

function Component({prop1, prop2}) {
  'use memo';

  let x = [{value: prop1}];
  let z;
  while (x.length < 2) {
    // there's a phi here for x (value before the loop and the reassignment later)

    // this mutation occurs before the reassigned value
    arrayPush(x, {value: prop2});

    if (x[0].value === prop1) {
      x = [{value: prop2}];
      const y = x;
      z = y[0];
    }
  }
  z.other = true;
  return <Stringify z={z} />;
}

export const FIXTURE_ENTRYPOINT = {
  fn: Component,
  params: [{prop1: 0, prop2: 'a'}],
  sequentialRenders: [
    {prop1: 0, prop2: 'a'},
    {prop1: 1, prop2: 'a'},
    {prop1: 1, prop2: 'b'},
    {prop1: 0, prop2: 'b'},
    {prop1: 0, prop2: 'a'},
  ],
};

Subdomains

Functions

Dependencies

  • shared-runtime

Frequently Asked Questions

What does capture-backedge-phi-with-later-mutation.js do?
capture-backedge-phi-with-later-mutation.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 capture-backedge-phi-with-later-mutation.js?
capture-backedge-phi-with-later-mutation.js defines 1 function(s): Component.
What does capture-backedge-phi-with-later-mutation.js depend on?
capture-backedge-phi-with-later-mutation.js imports 1 module(s): shared-runtime.
Where is capture-backedge-phi-with-later-mutation.js in the architecture?
capture-backedge-phi-with-later-mutation.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-mutability/capture-backedge-phi-with-later-mutation.js (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/new-mutability).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free