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
  ba00ad14_1a95_475e_df8a_aaa28d1487cc["walkBlockDeclarations()"]
  eb301be5_f530_960e_129f_798877ea7f83["walkIdentifiers()"]
  eb301be5_f530_960e_129f_798877ea7f83 -->|calls| ba00ad14_1a95_475e_df8a_aaa28d1487cc
  ccfe095d_b046_9c2c_9e32_6b444625187d["extractIdentifiers()"]
  ba00ad14_1a95_475e_df8a_aaa28d1487cc -->|calls| ccfe095d_b046_9c2c_9e32_6b444625187d
  style ba00ad14_1a95_475e_df8a_aaa28d1487cc 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