Skip to content

Commit d3f25ab

Browse files
committed
feat: Make 'explicit resource management' pass optional
1 parent 4b90da4 commit d3f25ab

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/transpiling/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ pub struct TranspileOptions {
104104
/// TC39 Decorators Proposal - https://github.com/tc39/proposal-decorators
105105
pub use_decorators_proposal: bool,
106106

107+
// Explicit resource management proposal - https://github.com/tc39/proposal-explicit-resource-management
108+
pub use_explicit_resource_management: bool,
109+
107110
/// When emitting a legacy decorator, also emit experimental decorator meta
108111
/// data. Defaults to `false`.
109112
pub emit_metadata: bool,
@@ -674,7 +677,10 @@ pub fn fold_program(
674677
proposal::decorator_2022_03::decorator_2022_03(),
675678
options.use_decorators_proposal,
676679
),
677-
proposal::explicit_resource_management::explicit_resource_management(),
680+
Optional::new(
681+
proposal::explicit_resource_management::explicit_resource_management(),
682+
options.use_explicit_resource_management
683+
),
678684
helpers::inject_helpers(marks.top_level),
679685
// transform imports to var decls before doing the typescript pass
680686
// so that swc doesn't do any optimizations on the import declarations

0 commit comments

Comments
 (0)