Skip to content

Commit aec150f

Browse files
committed
preset-env
1 parent 1aac149 commit aec150f

File tree

1 file changed

+5
-10
lines changed
  • crates/swc_ecma_preset_env/src

1 file changed

+5
-10
lines changed

crates/swc_ecma_preset_env/src/lib.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ where
5151
{
5252
let pass = noop_pass();
5353
let mut options = swc_ecma_transformer::Options::default();
54+
options.unresolved_ctxt = SyntaxContext::empty().apply_mark(unresolved_mark);
55+
options.assumptions = assumptions;
5456

5557
macro_rules! add {
5658
($prev:expr, $feature:ident, $pass:expr) => {{
@@ -195,16 +197,9 @@ where
195197
);
196198

197199
// ES2017
198-
let pass = add!(
199-
pass,
200-
AsyncToGenerator,
201-
es2017::async_to_generator(
202-
es2017::async_to_generator::Config {
203-
ignore_function_length: loose || assumptions.ignore_function_length,
204-
},
205-
unresolved_mark
206-
)
207-
);
200+
if !caniuse(Feature::AsyncToGenerator) {
201+
options.env.es2017.async_to_generator = true;
202+
}
208203

209204
// ES2016
210205
if !caniuse(Feature::ExponentiationOperator) {

0 commit comments

Comments
 (0)