Home / Function/ assertGlobalBinding() — react Function Reference

assertGlobalBinding() — react Function Reference

Architecture documentation for the assertGlobalBinding() function in Imports.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  5aa19ce4_3e31_5200_0219_de4147a588a1["assertGlobalBinding()"]
  1bba49a9_dc32_ad8e_e249_ee6b8eb56d16["ProgramContext"]
  5aa19ce4_3e31_5200_0219_de4147a588a1 -->|defined in| 1bba49a9_dc32_ad8e_e249_ee6b8eb56d16
  b5c63c35_0468_f7d9_414d_79eceec19099["hasReference()"]
  5aa19ce4_3e31_5200_0219_de4147a588a1 -->|calls| b5c63c35_0468_f7d9_414d_79eceec19099
  9f0e6a52_ff9e_00f3_1760_5fddfd89b234["Ok()"]
  5aa19ce4_3e31_5200_0219_de4147a588a1 -->|calls| 9f0e6a52_ff9e_00f3_1760_5fddfd89b234
  073c81a5_c389_d108_5b8f_4d6dc6eece83["push()"]
  5aa19ce4_3e31_5200_0219_de4147a588a1 -->|calls| 073c81a5_c389_d108_5b8f_4d6dc6eece83
  9217845a_d29d_c624_b607_e3b35cf604bc["Err()"]
  5aa19ce4_3e31_5200_0219_de4147a588a1 -->|calls| 9217845a_d29d_c624_b607_e3b35cf604bc
  style 5aa19ce4_3e31_5200_0219_de4147a588a1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Imports.ts lines 198–215

  assertGlobalBinding(
    name: string,
    localScope?: BabelScope,
  ): Result<void, CompilerError> {
    const scope = localScope ?? this.scope;
    if (!scope.hasReference(name) && !scope.hasBinding(name)) {
      return Ok(undefined);
    }
    const error = new CompilerError();
    error.push({
      category: ErrorCategory.Todo,
      reason: 'Encountered conflicting global in generated program',
      description: `Conflict from local binding ${name}`,
      loc: scope.getBinding(name)?.path.node.loc ?? null,
      suggestions: null,
    });
    return Err(error);
  }

Domain

Subdomains

Frequently Asked Questions

What does assertGlobalBinding() do?
assertGlobalBinding() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Imports.ts.
Where is assertGlobalBinding() defined?
assertGlobalBinding() is defined in compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Imports.ts at line 198.
What does assertGlobalBinding() call?
assertGlobalBinding() calls 4 function(s): Err, Ok, hasReference, push.

Analyze Your Own Codebase

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

Try Supermodel Free