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
  f404d19f_6b3c_ba8d_d39d_54669aacbf94["walkBlockDeclarations()"]
  89db3100_db23_2ba5_52ae_1299b220043a["walkIdentifiers()"]
  89db3100_db23_2ba5_52ae_1299b220043a -->|calls| f404d19f_6b3c_ba8d_d39d_54669aacbf94
  3a9aa470_2195_70c9_ad26_93b4ba070b60["extractIdentifiers()"]
  f404d19f_6b3c_ba8d_d39d_54669aacbf94 -->|calls| 3a9aa470_2195_70c9_ad26_93b4ba070b60
  style f404d19f_6b3c_ba8d_d39d_54669aacbf94 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.
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