Home / Function/ terminalHasFallthrough() — react Function Reference

terminalHasFallthrough() — react Function Reference

Architecture documentation for the terminalHasFallthrough() function in visitors.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  d0cd56ee_e8d2_fa25_8e21_652a56c56855["terminalHasFallthrough()"]
  2f3caf55_cc64_415c_55dd_9771ba7dc210["visitors.ts"]
  d0cd56ee_e8d2_fa25_8e21_652a56c56855 -->|defined in| 2f3caf55_cc64_415c_55dd_9771ba7dc210
  7b930d0b_9ec9_a382_a51f_3ffb682d5b9a["mergeConsecutiveBlocks()"]
  7b930d0b_9ec9_a382_a51f_3ffb682d5b9a -->|calls| d0cd56ee_e8d2_fa25_8e21_652a56c56855
  127c19ef_021e_5644_a84e_da0d0ed84999["terminalFallthrough()"]
  127c19ef_021e_5644_a84e_da0d0ed84999 -->|calls| d0cd56ee_e8d2_fa25_8e21_652a56c56855
  d7fde76c_4fd9_feb3_299b_798689f05bc6["assertExhaustive()"]
  d0cd56ee_e8d2_fa25_8e21_652a56c56855 -->|calls| d7fde76c_4fd9_feb3_299b_798689f05bc6
  style d0cd56ee_e8d2_fa25_8e21_652a56c56855 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/HIR/visitors.ts lines 962–1002

export function terminalHasFallthrough<
  T extends Terminal,
  U extends T & {fallthrough: BlockId},
>(terminal: T): terminal is U {
  switch (terminal.kind) {
    case 'maybe-throw':
    case 'goto':
    case 'return':
    case 'throw':
    case 'unreachable':
    case 'unsupported': {
      const _: undefined = terminal.fallthrough;
      return false;
    }
    case 'branch':
    case 'try':
    case 'do-while':
    case 'for-of':
    case 'for-in':
    case 'for':
    case 'if':
    case 'label':
    case 'logical':
    case 'optional':
    case 'sequence':
    case 'switch':
    case 'ternary':
    case 'while':
    case 'scope':
    case 'pruned-scope': {
      const _: BlockId = terminal.fallthrough;
      return true;
    }
    default: {
      assertExhaustive(
        terminal,
        `Unexpected terminal kind \`${(terminal as any).kind}\``,
      );
    }
  }
}

Subdomains

Frequently Asked Questions

What does terminalHasFallthrough() do?
terminalHasFallthrough() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/HIR/visitors.ts.
Where is terminalHasFallthrough() defined?
terminalHasFallthrough() is defined in compiler/packages/babel-plugin-react-compiler/src/HIR/visitors.ts at line 962.
What does terminalHasFallthrough() call?
terminalHasFallthrough() calls 1 function(s): assertExhaustive.
What calls terminalHasFallthrough()?
terminalHasFallthrough() is called by 2 function(s): mergeConsecutiveBlocks, terminalFallthrough.

Analyze Your Own Codebase

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

Try Supermodel Free