Home / Function/ isReferencedIdentifier() — vue Function Reference

isReferencedIdentifier() — vue Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  3b969150_5597_0548_8251_6f12c0644b67["isReferencedIdentifier()"]
  eb301be5_f530_960e_129f_798877ea7f83["walkIdentifiers()"]
  eb301be5_f530_960e_129f_798877ea7f83 -->|calls| 3b969150_5597_0548_8251_6f12c0644b67
  9a36a98d_0231_23c0_faad_444d44158684["isReferenced()"]
  3b969150_5597_0548_8251_6f12c0644b67 -->|calls| 9a36a98d_0231_23c0_faad_444d44158684
  22d4870d_f7a6_ae66_a23b_c5385723a602["isInDestructureAssignment()"]
  3b969150_5597_0548_8251_6f12c0644b67 -->|calls| 22d4870d_f7a6_ae66_a23b_c5385723a602
  style 3b969150_5597_0548_8251_6f12c0644b67 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/compiler-sfc/src/babelUtils.ts lines 87–117

export function isReferencedIdentifier(
  id: Identifier,
  parent: Node | null,
  parentStack: Node[]
) {
  if (!parent) {
    return true
  }

  // is a special keyword but parsed as identifier
  if (id.name === 'arguments') {
    return false
  }

  if (isReferenced(id, parent)) {
    return true
  }

  // babel's isReferenced check returns false for ids being assigned to, so we
  // need to cover those cases here
  switch (parent.type) {
    case 'AssignmentExpression':
    case 'AssignmentPattern':
      return true
    case 'ObjectPattern':
    case 'ArrayPattern':
      return isInDestructureAssignment(parent, parentStack)
  }

  return false
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does isReferencedIdentifier() do?
isReferencedIdentifier() is a function in the vue codebase.
What does isReferencedIdentifier() call?
isReferencedIdentifier() calls 2 function(s): isInDestructureAssignment, isReferenced.
What calls isReferencedIdentifier()?
isReferencedIdentifier() 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