Home / Function/ makeCatchBlock() — react Function Reference

makeCatchBlock() — react Function Reference

Architecture documentation for the makeCatchBlock() function in code-path-state.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  8b6f472a_911b_c694_11f3_31f352b3e621["makeCatchBlock()"]
  d3cee22c_5e2d_f853_c075_2c7c55e5d22c["CodePathState"]
  8b6f472a_911b_c694_11f3_31f352b3e621 -->|defined in| d3cee22c_5e2d_f853_c075_2c7c55e5d22c
  fcc7c411_4c84_b9a2_79b5_df3d388d50fc["pushForkContext()"]
  8b6f472a_911b_c694_11f3_31f352b3e621 -->|calls| fcc7c411_4c84_b9a2_79b5_df3d388d50fc
  c9bd3fa0_9a37_6446_ae50_3ac0a70bdaf1["forkBypassPath()"]
  8b6f472a_911b_c694_11f3_31f352b3e621 -->|calls| c9bd3fa0_9a37_6446_ae50_3ac0a70bdaf1
  style 8b6f472a_911b_c694_11f3_31f352b3e621 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/eslint-plugin-react-hooks/src/code-path-analysis/code-path-state.js lines 836–854

  makeCatchBlock() {
    const context = this.tryContext;
    const forkContext = this.forkContext;
    const thrown = context.thrownForkContext;

    // Update state.
    context.position = 'catch';
    context.thrownForkContext = ForkContext.newEmpty(forkContext);
    context.lastOfTryIsReachable = forkContext.reachable;

    // Merge thrown paths.
    thrown.add(forkContext.head);
    const thrownSegments = thrown.makeNext(0, -1);

    // Fork to a bypass and the merged thrown path.
    this.pushForkContext();
    this.forkBypassPath();
    this.forkContext.add(thrownSegments);
  }

Domain

Subdomains

Frequently Asked Questions

What does makeCatchBlock() do?
makeCatchBlock() is a function in the react codebase, defined in packages/eslint-plugin-react-hooks/src/code-path-analysis/code-path-state.js.
Where is makeCatchBlock() defined?
makeCatchBlock() is defined in packages/eslint-plugin-react-hooks/src/code-path-analysis/code-path-state.js at line 836.
What does makeCatchBlock() call?
makeCatchBlock() calls 2 function(s): forkBypassPath, pushForkContext.

Analyze Your Own Codebase

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

Try Supermodel Free