Home / Function/ printLValue() — react Function Reference

printLValue() — react Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  4c8e9f15_76da_b25c_3fcd_2158b484c064["printLValue()"]
  6976a9ee_9d8e_4f16_3016_495f39aff2fd["PrintHIR.ts"]
  4c8e9f15_76da_b25c_3fcd_2158b484c064 -->|defined in| 6976a9ee_9d8e_4f16_3016_495f39aff2fd
  bf7f1cf7_fc0e_6bac_827c_8d36d98126da["printPlace()"]
  4c8e9f15_76da_b25c_3fcd_2158b484c064 -->|calls| bf7f1cf7_fc0e_6bac_827c_8d36d98126da
  d7fde76c_4fd9_feb3_299b_798689f05bc6["assertExhaustive()"]
  4c8e9f15_76da_b25c_3fcd_2158b484c064 -->|calls| d7fde76c_4fd9_feb3_299b_798689f05bc6
  style 4c8e9f15_76da_b25c_3fcd_2158b484c064 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/HIR/PrintHIR.ts lines 746–778

export function printLValue(lval: LValue): string {
  let lvalue = `${printPlace(lval.place)}`;

  switch (lval.kind) {
    case InstructionKind.Let: {
      return `Let ${lvalue}`;
    }
    case InstructionKind.Const: {
      return `Const ${lvalue}$`;
    }
    case InstructionKind.Reassign: {
      return `Reassign ${lvalue}`;
    }
    case InstructionKind.Catch: {
      return `Catch ${lvalue}`;
    }
    case InstructionKind.HoistedConst: {
      return `HoistedConst ${lvalue}$`;
    }
    case InstructionKind.HoistedLet: {
      return `HoistedLet ${lvalue}$`;
    }
    case InstructionKind.Function: {
      return `Function ${lvalue}$`;
    }
    case InstructionKind.HoistedFunction: {
      return `HoistedFunction ${lvalue}$`;
    }
    default: {
      assertExhaustive(lval.kind, `Unexpected lvalue kind \`${lval.kind}\``);
    }
  }
}

Subdomains

Frequently Asked Questions

What does printLValue() do?
printLValue() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/HIR/PrintHIR.ts.
Where is printLValue() defined?
printLValue() is defined in compiler/packages/babel-plugin-react-compiler/src/HIR/PrintHIR.ts at line 746.
What does printLValue() call?
printLValue() calls 2 function(s): assertExhaustive, printPlace.

Analyze Your Own Codebase

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

Try Supermodel Free