walkObjectPattern() — vue Function Reference
Architecture documentation for the walkObjectPattern() function in compileScript.ts from the vue codebase.
Entity Profile
Dependency Diagram
graph TD 9ae6652a_4e20_d88f_ad15_1cfe7add8cc2["walkObjectPattern()"] 4816b617_49b6_86ec_ba60_1b6ac824a31a["walkDeclaration()"] 4816b617_49b6_86ec_ba60_1b6ac824a31a -->|calls| 9ae6652a_4e20_d88f_ad15_1cfe7add8cc2 8fa928f1_7d66_f996_7796_01a10820f019["walkPattern()"] 8fa928f1_7d66_f996_7796_01a10820f019 -->|calls| 9ae6652a_4e20_d88f_ad15_1cfe7add8cc2 72b07125_46f6_2586_ee42_1bdaa78eb7e2["registerBinding()"] 9ae6652a_4e20_d88f_ad15_1cfe7add8cc2 -->|calls| 72b07125_46f6_2586_ee42_1bdaa78eb7e2 8fa928f1_7d66_f996_7796_01a10820f019["walkPattern()"] 9ae6652a_4e20_d88f_ad15_1cfe7add8cc2 -->|calls| 8fa928f1_7d66_f996_7796_01a10820f019 style 9ae6652a_4e20_d88f_ad15_1cfe7add8cc2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/compiler-sfc/src/compileScript.ts lines 1349–1375
function walkObjectPattern(
node: ObjectPattern,
bindings: Record<string, BindingTypes>,
isConst: boolean,
isDefineCall = false
) {
for (const p of node.properties) {
if (p.type === 'ObjectProperty') {
if (p.key.type === 'Identifier' && p.key === p.value) {
// shorthand: const { x } = ...
const type = isDefineCall
? BindingTypes.SETUP_CONST
: isConst
? BindingTypes.SETUP_MAYBE_REF
: BindingTypes.SETUP_LET
registerBinding(bindings, p.key, type)
} else {
walkPattern(p.value, bindings, isConst, isDefineCall)
}
} else {
// ...rest
// argument can only be identifier when destructuring
const type = isConst ? BindingTypes.SETUP_CONST : BindingTypes.SETUP_LET
registerBinding(bindings, p.argument as Identifier, type)
}
}
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does walkObjectPattern() do?
walkObjectPattern() is a function in the vue codebase.
What does walkObjectPattern() call?
walkObjectPattern() calls 2 function(s): registerBinding, walkPattern.
What calls walkObjectPattern()?
walkObjectPattern() is called by 2 function(s): walkDeclaration, walkPattern.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free