Home / Function/ emitPropertyLoad() — react Function Reference

emitPropertyLoad() — react Function Reference

Architecture documentation for the emitPropertyLoad() function in LowerContextAccess.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  11122e10_ce2f_5f61_cb70_9191695700a8["emitPropertyLoad()"]
  ed770299_f9db_61d4_407c_b8ead52e24ec["LowerContextAccess.ts"]
  11122e10_ce2f_5f61_cb70_9191695700a8 -->|defined in| ed770299_f9db_61d4_407c_b8ead52e24ec
  c059451e_3ed5_62a9_6995_a4adbca6d62c["emitSelectorFn()"]
  c059451e_3ed5_62a9_6995_a4adbca6d62c -->|calls| 11122e10_ce2f_5f61_cb70_9191695700a8
  49446ae1_b830_9411_8258_1139d21b314b["createTemporaryPlace()"]
  11122e10_ce2f_5f61_cb70_9191695700a8 -->|calls| 49446ae1_b830_9411_8258_1139d21b314b
  style 11122e10_ce2f_5f61_cb70_9191695700a8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Optimization/LowerContextAccess.ts lines 180–217

function emitPropertyLoad(
  env: Environment,
  obj: Place,
  property: string,
): {instructions: Array<Instruction>; element: Place} {
  const loadObj: LoadLocal = {
    kind: 'LoadLocal',
    place: obj,
    loc: GeneratedSource,
  };
  const object: Place = createTemporaryPlace(env, GeneratedSource);
  const loadLocalInstr: Instruction = {
    lvalue: object,
    value: loadObj,
    id: makeInstructionId(0),
    effects: null,
    loc: GeneratedSource,
  };

  const loadProp: PropertyLoad = {
    kind: 'PropertyLoad',
    object,
    property: makePropertyLiteral(property),
    loc: GeneratedSource,
  };
  const element: Place = createTemporaryPlace(env, GeneratedSource);
  const loadPropInstr: Instruction = {
    lvalue: element,
    value: loadProp,
    id: makeInstructionId(0),
    effects: null,
    loc: GeneratedSource,
  };
  return {
    instructions: [loadLocalInstr, loadPropInstr],
    element: element,
  };
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does emitPropertyLoad() do?
emitPropertyLoad() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Optimization/LowerContextAccess.ts.
Where is emitPropertyLoad() defined?
emitPropertyLoad() is defined in compiler/packages/babel-plugin-react-compiler/src/Optimization/LowerContextAccess.ts at line 180.
What does emitPropertyLoad() call?
emitPropertyLoad() calls 1 function(s): createTemporaryPlace.
What calls emitPropertyLoad()?
emitPropertyLoad() is called by 1 function(s): emitSelectorFn.

Analyze Your Own Codebase

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

Try Supermodel Free