Skip to content

Commit

Permalink
fix(ssr): fix sstTransfrom catchclause (fix vitejs#2667)
Browse files Browse the repository at this point in the history
  • Loading branch information
leemove committed Apr 13, 2021
1 parent 44bfb96 commit eb49d16
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/vite/src/node/ssr/ssrTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export async function ssrTransform(
ecmaVersion: 2021,
locations: true
}) as any

let uid = 0
const deps = new Set<string>()
const idToImportMap = new Map<string, string>()
Expand Down Expand Up @@ -322,9 +321,10 @@ function walk(
function isRefIdentifier(id: Identifier, parent: _Node, parentStack: _Node[]) {
// declaration id
if (
(parent.type === 'VariableDeclarator' ||
parent.type === 'CatchClause' ||
((parent.type === 'VariableDeclarator' ||
parent.type === 'ClassDeclaration') &&
parent.id === id
parent.id === id)
) {
return false
}
Expand Down

0 comments on commit eb49d16

Please sign in to comment.