Home / Function/ printMutableRange() — react Function Reference

printMutableRange() — react Function Reference

Architecture documentation for the printMutableRange() function in PrintHIR.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  225c828e_a4a0_ec4a_56d6_d351085c81d4["printMutableRange()"]
  6976a9ee_9d8e_4f16_3016_495f39aff2fd["PrintHIR.ts"]
  225c828e_a4a0_ec4a_56d6_d351085c81d4 -->|defined in| 6976a9ee_9d8e_4f16_3016_495f39aff2fd
  8faf797b_f577_1d83_65a6_29b8dcb97348["printPhi()"]
  8faf797b_f577_1d83_65a6_29b8dcb97348 -->|calls| 225c828e_a4a0_ec4a_56d6_d351085c81d4
  bf7f1cf7_fc0e_6bac_827c_8d36d98126da["printPlace()"]
  bf7f1cf7_fc0e_6bac_827c_8d36d98126da -->|calls| 225c828e_a4a0_ec4a_56d6_d351085c81d4
  787255c1_c182_b97c_0cdf_02f4ffb5203c["isMutable()"]
  225c828e_a4a0_ec4a_56d6_d351085c81d4 -->|calls| 787255c1_c182_b97c_0cdf_02f4ffb5203c
  style 225c828e_a4a0_ec4a_56d6_d351085c81d4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/HIR/PrintHIR.ts lines 728–744

function printMutableRange(identifier: Identifier): string {
  if (DEBUG_MUTABLE_RANGES) {
    // if debugging, print both the identifier and scope range if they differ
    const range = identifier.mutableRange;
    const scopeRange = identifier.scope?.range;
    if (
      scopeRange != null &&
      (scopeRange.start !== range.start || scopeRange.end !== range.end)
    ) {
      return `[${range.start}:${range.end}] scope=[${scopeRange.start}:${scopeRange.end}]`;
    }
    return isMutable(range) ? `[${range.start}:${range.end}]` : '';
  }
  // in non-debug mode, prefer the scope range if it exists
  const range = identifier.scope?.range ?? identifier.mutableRange;
  return isMutable(range) ? `[${range.start}:${range.end}]` : '';
}

Subdomains

Calls

Frequently Asked Questions

What does printMutableRange() do?
printMutableRange() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/HIR/PrintHIR.ts.
Where is printMutableRange() defined?
printMutableRange() is defined in compiler/packages/babel-plugin-react-compiler/src/HIR/PrintHIR.ts at line 728.
What does printMutableRange() call?
printMutableRange() calls 1 function(s): isMutable.
What calls printMutableRange()?
printMutableRange() is called by 2 function(s): printPhi, printPlace.

Analyze Your Own Codebase

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

Try Supermodel Free