Skip to content

Commit

Permalink
fix: cannot recognize template context in arrow function arg typeof
Browse files Browse the repository at this point in the history
close #1326
  • Loading branch information
johnsoncodehk committed May 22, 2022
1 parent d23cec7 commit b7e69b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vue-code-gen/src/transform.ts
Expand Up @@ -106,8 +106,12 @@ function walkIdentifiers(

const functionArgs: string[] = [];

for (const param of node.parameters)
for (const param of node.parameters) {
colletVars(ts, param.name, functionArgs);
if (param.type) {
walkIdentifiers(ts, param.type, cb, localVars);
}
}

for (const varName of functionArgs)
localVars[varName] = (localVars[varName] ?? 0) + 1;
Expand Down

0 comments on commit b7e69b0

Please sign in to comment.