Skip to content

Commit 2099a39

Browse files
committed
preset-env
1 parent c3bade5 commit 2099a39

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) => {{
@@ -197,16 +199,9 @@ where
197199
);
198200

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

211206
// ES2016
212207
if !caniuse(Feature::ExponentiationOperator) {

0 commit comments

Comments
 (0)