fix: catch clause scope (#11209)

pull/11217/head
Tan Li Hau 3 months ago committed by GitHub
parent d51075c154
commit 27d48c601f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -506,7 +506,7 @@ export function create_scopes(ast, root, allow_reactive_declarations, parent) {
scopes.set(node, scope);
for (const id of extract_identifiers(node.param)) {
state.scope.declare(id, 'normal', 'let');
scope.declare(id, 'normal', 'let');
}
next({ scope });

@ -0,0 +1,16 @@
<script>
function test() {
try {
throw new TypeError("oops1");
} catch (error) {
console.log(error);
}
try {
throw new TypeError("oops2");
} catch (error) {
console.log(error);
}
}
test();
</script>
Loading…
Cancel
Save