Home / Function/ testFunction() — react Function Reference

testFunction() — react Function Reference

Architecture documentation for the testFunction() function in mutable-lifetime-loops.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  c1abea5d_e538_1465_adc4_dd7d719df6fa["testFunction()"]
  903e4398_119d_2da3_16e0_7c8f313f05ee["mutable-lifetime-loops.js"]
  c1abea5d_e538_1465_adc4_dd7d719df6fa -->|defined in| 903e4398_119d_2da3_16e0_7c8f313f05ee
  845db7b2_28da_0ca9_a364_69fca15394b6["mutate()"]
  c1abea5d_e538_1465_adc4_dd7d719df6fa -->|calls| 845db7b2_28da_0ca9_a364_69fca15394b6
  d5c9a0bd_b9ba_0abe_0894_51257dc21cd7["cond()"]
  c1abea5d_e538_1465_adc4_dd7d719df6fa -->|calls| d5c9a0bd_b9ba_0abe_0894_51257dc21cd7
  style c1abea5d_e538_1465_adc4_dd7d719df6fa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutable-lifetime-loops.js lines 15–46

function testFunction(props) {
  let a = {};
  let b = {};
  let c = {};
  let d = {};
  while (true) {
    let z = a;
    a = b;
    b = c;
    c = d;
    d = z;
    mutate(a, b);
    if (cond(a)) {
      break;
    }
  }

  // all of these tests are seemingly readonly, since the values are never directly
  // mutated again. but they are all aliased by `d`, which is later modified, and
  // these are therefore mutable references:
  if (a) {
  }
  if (b) {
  }
  if (c) {
  }
  if (d) {
  }

  mutate(d, null);
  return {a, b, c, d};
}

Subdomains

Frequently Asked Questions

What does testFunction() do?
testFunction() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutable-lifetime-loops.js.
Where is testFunction() defined?
testFunction() is defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/mutable-lifetime-loops.js at line 15.
What does testFunction() call?
testFunction() calls 2 function(s): cond, mutate.

Analyze Your Own Codebase

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

Try Supermodel Free