Skip to content

Commit 99ba555

Browse files
authoredMar 15, 2025··
fix(es/proposal): Fix declarations for explicit-resource-management (#10198)
**Description:** Preserve the level of function declarations and replace the `kind` of top-level variable declarations to `var`. **Related issue:** - Closes #10168
1 parent e6b7cee commit 99ba555

File tree

206 files changed

+3404
-3379
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+3404
-3379
lines changed
 

‎.changeset/gentle-parrots-heal.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
swc_ecma_transforms_proposal: patch
3+
swc_core: patch
4+
---
5+
6+
fix(es/proposal): fix declarations for explicit-resource-management

‎crates/swc/tests/fixture/issues-8xxx/8020/output/1.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ try {
99
const foo = _ts_add_disposable_resource._(env, null, false);
1010
const bar = 1;
1111
console.log(baz());
12-
function baz() {
13-
return bar;
14-
}
1512
} catch (e) {
1613
env.error = e;
1714
env.hasError = true;
1815
} finally{
1916
_ts_dispose_resources._(env);
2017
}
18+
function baz() {
19+
return bar;
20+
}

0 commit comments

Comments
 (0)
Please sign in to comment.