processExp() — vue Function Reference
Architecture documentation for the processExp() function in compileScript.ts from the vue codebase.
Entity Profile
Dependency Diagram
graph TD 72c10b69_fb02_fbf6_63d5_43832727d4f7["processExp()"] b9f12a63_b611_1b00_0717_3ff21d7ce156["compileScript.ts"] 72c10b69_fb02_fbf6_63d5_43832727d4f7 -->|defined in| b9f12a63_b611_1b00_0717_3ff21d7ce156 77885a00_badc_8a1d_b8c5_1d9ab042a484["resolveTemplateUsageCheckString()"] 77885a00_badc_8a1d_b8c5_1d9ab042a484 -->|calls| 72c10b69_fb02_fbf6_63d5_43832727d4f7 6821e51e_382f_8ff8_ca9d_3b77f896018a["walkIdentifiers()"] 72c10b69_fb02_fbf6_63d5_43832727d4f7 -->|calls| 6821e51e_382f_8ff8_ca9d_3b77f896018a cf49bf66_1716_47a9_b7ce_2ff9a30d62b1["stripStrings()"] 72c10b69_fb02_fbf6_63d5_43832727d4f7 -->|calls| cf49bf66_1716_47a9_b7ce_2ff9a30d62b1 style 72c10b69_fb02_fbf6_63d5_43832727d4f7 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/compiler-sfc/src/compileScript.ts lines 1841–1863
function processExp(exp: string, isTS: boolean, dir?: string): string {
if (isTS && / as\s+\w|<.*>|:/.test(exp)) {
if (dir === 'slot') {
exp = `(${exp})=>{}`
} else if (dir === 'on') {
exp = `()=>{return ${exp}}`
} else if (dir === 'for') {
const inMatch = exp.match(forAliasRE)
if (inMatch) {
const [, LHS, RHS] = inMatch
return processExp(`(${LHS})=>{}`, true) + processExp(RHS, true)
}
}
let ret = ''
// has potential type cast or generic arguments that uses types
const ast = parseExpression(exp, { plugins: ['typescript'] })
walkIdentifiers(ast, node => {
ret += `,` + node.name
})
return ret
}
return stripStrings(exp)
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does processExp() do?
processExp() is a function in the vue codebase, defined in packages/compiler-sfc/src/compileScript.ts.
Where is processExp() defined?
processExp() is defined in packages/compiler-sfc/src/compileScript.ts at line 1841.
What does processExp() call?
processExp() calls 2 function(s): stripStrings, walkIdentifiers.
What calls processExp()?
processExp() is called by 1 function(s): resolveTemplateUsageCheckString.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free