Home / Function/ walkBlockDeclarations() — vue Function Reference

walkBlockDeclarations() — vue Function Reference

Architecture documentation for the walkBlockDeclarations() function in babelUtils.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  5e4207f6_76c5_de5d_945f_5dc740607887["walkBlockDeclarations()"]
  946e0fa6_6c05_b820_0bd7_980d6d869192["babelUtils.ts"]
  5e4207f6_76c5_de5d_945f_5dc740607887 -->|defined in| 946e0fa6_6c05_b820_0bd7_980d6d869192
  6821e51e_382f_8ff8_ca9d_3b77f896018a["walkIdentifiers()"]
  6821e51e_382f_8ff8_ca9d_3b77f896018a -->|calls| 5e4207f6_76c5_de5d_945f_5dc740607887
  4c627be7_6323_9d1a_49bc_0a2a140978c0["extractIdentifiers()"]
  5e4207f6_76c5_de5d_945f_5dc740607887 -->|calls| 4c627be7_6323_9d1a_49bc_0a2a140978c0
  style 5e4207f6_76c5_de5d_945f_5dc740607887 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/compiler-sfc/src/babelUtils.ts lines 151–171

export function walkBlockDeclarations(
  block: BlockStatement | Program,
  onIdent: (node: Identifier) => void
) {
  for (const stmt of block.body) {
    if (stmt.type === 'VariableDeclaration') {
      if (stmt.declare) continue
      for (const decl of stmt.declarations) {
        for (const id of extractIdentifiers(decl.id)) {
          onIdent(id)
        }
      }
    } else if (
      stmt.type === 'FunctionDeclaration' ||
      stmt.type === 'ClassDeclaration'
    ) {
      if (stmt.declare || !stmt.id) continue
      onIdent(stmt.id)
    }
  }
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does walkBlockDeclarations() do?
walkBlockDeclarations() is a function in the vue codebase, defined in packages/compiler-sfc/src/babelUtils.ts.
Where is walkBlockDeclarations() defined?
walkBlockDeclarations() is defined in packages/compiler-sfc/src/babelUtils.ts at line 151.
What does walkBlockDeclarations() call?
walkBlockDeclarations() calls 1 function(s): extractIdentifiers.
What calls walkBlockDeclarations()?
walkBlockDeclarations() is called by 1 function(s): walkIdentifiers.

Analyze Your Own Codebase

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

Try Supermodel Free