Home / Function/ lowerArguments() — react Function Reference

lowerArguments() — react Function Reference

Architecture documentation for the lowerArguments() function in BuildHIR.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  a1ea0998_17ee_ee03_aad6_a8367893b004["lowerArguments()"]
  e04c04d6_37a7_1dc3_7fae_7d07660d0af9["BuildHIR.ts"]
  a1ea0998_17ee_ee03_aad6_a8367893b004 -->|defined in| e04c04d6_37a7_1dc3_7fae_7d07660d0af9
  ace1177a_10b2_b870_31fd_da4aa845554c["lowerExpression()"]
  ace1177a_10b2_b870_31fd_da4aa845554c -->|calls| a1ea0998_17ee_ee03_aad6_a8367893b004
  e401a324_13b9_af8a_12c7_b731c9f220a3["lowerOptionalCallExpression()"]
  e401a324_13b9_af8a_12c7_b731c9f220a3 -->|calls| a1ea0998_17ee_ee03_aad6_a8367893b004
  5bae3f87_1b76_e568_9b44_1d2fb59f73d8["lowerExpressionToTemporary()"]
  a1ea0998_17ee_ee03_aad6_a8367893b004 -->|calls| 5bae3f87_1b76_e568_9b44_1d2fb59f73d8
  073c81a5_c389_d108_5b8f_4d6dc6eece83["push()"]
  a1ea0998_17ee_ee03_aad6_a8367893b004 -->|calls| 073c81a5_c389_d108_5b8f_4d6dc6eece83
  style a1ea0998_17ee_ee03_aad6_a8367893b004 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/HIR/BuildHIR.ts lines 3142–3172

function lowerArguments(
  builder: HIRBuilder,
  expr: Array<
    NodePath<
      | t.Expression
      | t.SpreadElement
      | t.JSXNamespacedName
      | t.ArgumentPlaceholder
    >
  >,
): Array<Place | SpreadPattern> {
  let args: Array<Place | SpreadPattern> = [];
  for (const argPath of expr) {
    if (argPath.isSpreadElement()) {
      args.push({
        kind: 'Spread',
        place: lowerExpressionToTemporary(builder, argPath.get('argument')),
      });
    } else if (argPath.isExpression()) {
      args.push(lowerExpressionToTemporary(builder, argPath));
    } else {
      builder.errors.push({
        reason: `(BuildHIR::lowerExpression) Handle ${argPath.type} arguments in CallExpression`,
        category: ErrorCategory.Todo,
        loc: argPath.node.loc ?? null,
        suggestions: null,
      });
    }
  }
  return args;
}

Subdomains

Frequently Asked Questions

What does lowerArguments() do?
lowerArguments() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/HIR/BuildHIR.ts.
Where is lowerArguments() defined?
lowerArguments() is defined in compiler/packages/babel-plugin-react-compiler/src/HIR/BuildHIR.ts at line 3142.
What does lowerArguments() call?
lowerArguments() calls 2 function(s): lowerExpressionToTemporary, push.
What calls lowerArguments()?
lowerArguments() is called by 2 function(s): lowerExpression, lowerOptionalCallExpression.

Analyze Your Own Codebase

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

Try Supermodel Free