Home / Function/ debug() — react Function Reference

debug() — react Function Reference

Architecture documentation for the debug() function in InferMutationAliasingEffects.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  0b368f40_7a34_9775_9972_d6bce52eb643["debug()"]
  7f9a06c8_8e18_76fc_0edd_1f0d608aae44["InferenceState"]
  0b368f40_7a34_9775_9972_d6bce52eb643 -->|defined in| 7f9a06c8_8e18_76fc_0edd_1f0d608aae44
  1d28042a_1677_72f1_73ab_6aec596d00f7["debugAbstractValue()"]
  0b368f40_7a34_9775_9972_d6bce52eb643 -->|calls| 1d28042a_1677_72f1_73ab_6aec596d00f7
  f3619b34_2818_79d3_d2a6_72b9bcfc9d1e["printInstructionValue()"]
  0b368f40_7a34_9775_9972_d6bce52eb643 -->|calls| f3619b34_2818_79d3_d2a6_72b9bcfc9d1e
  8e8b7ee8_d3c2_f98d_17e1_c5ff5fff1940["map()"]
  0b368f40_7a34_9775_9972_d6bce52eb643 -->|calls| 8e8b7ee8_d3c2_f98d_17e1_c5ff5fff1940
  style 0b368f40_7a34_9775_9972_d6bce52eb643 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Inference/InferMutationAliasingEffects.ts lines 1622–1644

  debug(): any {
    const result: any = {values: {}, variables: {}};
    const objects: Map<InstructionValue, number> = new Map();
    function identify(value: InstructionValue): number {
      let id = objects.get(value);
      if (id == null) {
        id = objects.size;
        objects.set(value, id);
      }
      return id;
    }
    for (const [value, kind] of this.#values) {
      const id = identify(value);
      result.values[id] = {
        abstract: this.debugAbstractValue(kind),
        value: printInstructionValue(value),
      };
    }
    for (const [variable, values] of this.#variables) {
      result.variables[`$${variable}`] = [...values].map(identify);
    }
    return result;
  }

Domain

Subdomains

Frequently Asked Questions

What does debug() do?
debug() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Inference/InferMutationAliasingEffects.ts.
Where is debug() defined?
debug() is defined in compiler/packages/babel-plugin-react-compiler/src/Inference/InferMutationAliasingEffects.ts at line 1622.
What does debug() call?
debug() calls 3 function(s): debugAbstractValue, map, printInstructionValue.

Analyze Your Own Codebase

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

Try Supermodel Free