lowerIdentifierForAssignment() — react Function Reference
Architecture documentation for the lowerIdentifierForAssignment() function in BuildHIR.ts from the react codebase.
Entity Profile
Dependency Diagram
graph TD d647d797_7545_2cf1_8751_866151e2ddee["lowerIdentifierForAssignment()"] e04c04d6_37a7_1dc3_7fae_7d07660d0af9["BuildHIR.ts"] d647d797_7545_2cf1_8751_866151e2ddee -->|defined in| e04c04d6_37a7_1dc3_7fae_7d07660d0af9 ace1177a_10b2_b870_31fd_da4aa845554c["lowerExpression()"] ace1177a_10b2_b870_31fd_da4aa845554c -->|calls| d647d797_7545_2cf1_8751_866151e2ddee b98634fa_1f83_e1bb_1406_d07e28c93b41["lowerAssignment()"] b98634fa_1f83_e1bb_1406_d07e28c93b41 -->|calls| d647d797_7545_2cf1_8751_866151e2ddee c753d1dc_3d72_6c26_43d1_a3614937be80["resolveIdentifier()"] d647d797_7545_2cf1_8751_866151e2ddee -->|calls| c753d1dc_3d72_6c26_43d1_a3614937be80 073c81a5_c389_d108_5b8f_4d6dc6eece83["push()"] d647d797_7545_2cf1_8751_866151e2ddee -->|calls| 073c81a5_c389_d108_5b8f_4d6dc6eece83 style d647d797_7545_2cf1_8751_866151e2ddee fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
compiler/packages/babel-plugin-react-compiler/src/HIR/BuildHIR.ts lines 3614–3658
function lowerIdentifierForAssignment(
builder: HIRBuilder,
loc: SourceLocation,
kind: InstructionKind,
path: NodePath<t.Identifier>,
): Place | {kind: 'Global'; name: string} | null {
const binding = builder.resolveIdentifier(path);
if (binding.kind !== 'Identifier') {
if (kind === InstructionKind.Reassign) {
return {kind: 'Global', name: path.node.name};
} else {
// Else its an internal error bc we couldn't find the binding
builder.errors.push({
reason: `(BuildHIR::lowerAssignment) Could not find binding for declaration.`,
category: ErrorCategory.Invariant,
loc: path.node.loc ?? null,
suggestions: null,
});
return null;
}
} else if (
binding.bindingKind === 'const' &&
kind === InstructionKind.Reassign
) {
builder.errors.push({
reason: `Cannot reassign a \`const\` variable`,
category: ErrorCategory.Syntax,
loc: path.node.loc ?? null,
description:
binding.identifier.name != null
? `\`${binding.identifier.name.value}\` is declared as const`
: null,
});
return null;
}
const place: Place = {
kind: 'Identifier',
identifier: binding.identifier,
effect: Effect.Unknown,
reactive: false,
loc,
};
return place;
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does lowerIdentifierForAssignment() do?
lowerIdentifierForAssignment() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/HIR/BuildHIR.ts.
Where is lowerIdentifierForAssignment() defined?
lowerIdentifierForAssignment() is defined in compiler/packages/babel-plugin-react-compiler/src/HIR/BuildHIR.ts at line 3614.
What does lowerIdentifierForAssignment() call?
lowerIdentifierForAssignment() calls 2 function(s): push, resolveIdentifier.
What calls lowerIdentifierForAssignment()?
lowerIdentifierForAssignment() is called by 2 function(s): lowerAssignment, lowerExpression.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free