Home / Function/ codegenLValue() — react Function Reference

codegenLValue() — react Function Reference

Architecture documentation for the codegenLValue() function in CodegenReactiveFunction.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  fa00221c_3f87_f634_2655_5b0ca5860306["codegenLValue()"]
  dc7f10c2_c914_a162_d02b_a10a15c64a5f["CodegenReactiveFunction.ts"]
  fa00221c_3f87_f634_2655_5b0ca5860306 -->|defined in| dc7f10c2_c914_a162_d02b_a10a15c64a5f
  4f146c25_f9b5_fd01_865f_04b2fc3071a8["codegenTerminal()"]
  4f146c25_f9b5_fd01_865f_04b2fc3071a8 -->|calls| fa00221c_3f87_f634_2655_5b0ca5860306
  c65f3ebd_fe8f_602d_b885_bc79e6e81b1d["codegenInstructionNullable()"]
  c65f3ebd_fe8f_602d_b885_bc79e6e81b1d -->|calls| fa00221c_3f87_f634_2655_5b0ca5860306
  d8edf87e_ea78_c9d0_b5c9_13d68891efec["codegenInstructionValue()"]
  d8edf87e_ea78_c9d0_b5c9_13d68891efec -->|calls| fa00221c_3f87_f634_2655_5b0ca5860306
  aae33d98_de86_6a92_adb8_6526404234ff["codegenArrayPattern()"]
  aae33d98_de86_6a92_adb8_6526404234ff -->|calls| fa00221c_3f87_f634_2655_5b0ca5860306
  aae33d98_de86_6a92_adb8_6526404234ff["codegenArrayPattern()"]
  fa00221c_3f87_f634_2655_5b0ca5860306 -->|calls| aae33d98_de86_6a92_adb8_6526404234ff
  a11bc4aa_cf2e_833d_d17b_0c1eefd2a759["codegenObjectPropertyKey()"]
  fa00221c_3f87_f634_2655_5b0ca5860306 -->|calls| a11bc4aa_cf2e_833d_d17b_0c1eefd2a759
  9bb6f6d9_ff05_0f27_1a27_bc67145db7ba["convertIdentifier()"]
  fa00221c_3f87_f634_2655_5b0ca5860306 -->|calls| 9bb6f6d9_ff05_0f27_1a27_bc67145db7ba
  d7fde76c_4fd9_feb3_299b_798689f05bc6["assertExhaustive()"]
  fa00221c_3f87_f634_2655_5b0ca5860306 -->|calls| d7fde76c_4fd9_feb3_299b_798689f05bc6
  style fa00221c_3f87_f634_2655_5b0ca5860306 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/CodegenReactiveFunction.ts lines 2540–2582

function codegenLValue(
  cx: Context,
  pattern: Pattern | Place | SpreadPattern,
): t.ArrayPattern | t.ObjectPattern | t.RestElement | t.Identifier {
  switch (pattern.kind) {
    case 'ArrayPattern': {
      return codegenArrayPattern(cx, pattern);
    }
    case 'ObjectPattern': {
      return createObjectPattern(
        pattern.loc,
        pattern.properties.map(property => {
          if (property.kind === 'ObjectProperty') {
            const key = codegenObjectPropertyKey(cx, property.key);
            const value = codegenLValue(cx, property.place);
            return t.objectProperty(
              key,
              value,
              property.key.kind === 'computed',
              key.type === 'Identifier' &&
                value.type === 'Identifier' &&
                value.name === key.name,
            );
          } else {
            return t.restElement(codegenLValue(cx, property.place));
          }
        }),
      );
    }
    case 'Spread': {
      return t.restElement(codegenLValue(cx, pattern.place));
    }
    case 'Identifier': {
      return convertIdentifier(pattern.identifier);
    }
    default: {
      assertExhaustive(
        pattern,
        `Unexpected pattern kind \`${(pattern as any).kind}\``,
      );
    }
  }
}

Domain

Subdomains

Frequently Asked Questions

What does codegenLValue() do?
codegenLValue() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/CodegenReactiveFunction.ts.
Where is codegenLValue() defined?
codegenLValue() is defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/CodegenReactiveFunction.ts at line 2540.
What does codegenLValue() call?
codegenLValue() calls 4 function(s): assertExhaustive, codegenArrayPattern, codegenObjectPropertyKey, convertIdentifier.
What calls codegenLValue()?
codegenLValue() is called by 4 function(s): codegenArrayPattern, codegenInstructionNullable, codegenInstructionValue, codegenTerminal.

Analyze Your Own Codebase

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

Try Supermodel Free