Skip to content

Commit

Permalink
fix(es/transforms/compat): Fix async_to_generator pass. (swc-projec…
Browse files Browse the repository at this point in the history
…t#1724)

swc_ecma_transforms_compat:
 - `async_to_generator`: Fix async iife. (swc-project#1722)
 - `async_to_generator`: Don't apply iife optimization to named function expressions.
 - `async_to_generator`: Remove duplicated works.
 - `async_to_generator`: Support `await for`. (swc-project#1721)
 - `async_to_generator`: Support async generators.
  • Loading branch information
kdy1 authored May 21, 2021
1 parent c2bd319 commit a1341dc
Show file tree
Hide file tree
Showing 14 changed files with 998 additions and 90 deletions.
2 changes: 1 addition & 1 deletion ecmascript/preset_env/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ documentation = "https://rustdoc.swc.rs/swc_ecma_preset_env/"
edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_preset_env"
version = "0.20.2"
version = "0.20.3"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 2 additions & 0 deletions ecmascript/transforms/base/src/fixer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,11 @@ impl VisitMut for Fixer<'_> {
}

fn visit_mut_expr(&mut self, e: &mut Expr) {
let ctx = self.ctx;
self.unwrap_expr(e);
e.visit_mut_children_with(self);

self.ctx = ctx;
self.wrap_with_paren_if_required(e)
}
fn visit_mut_expr_or_spread(&mut self, e: &mut ExprOrSpread) {
Expand Down
2 changes: 1 addition & 1 deletion ecmascript/transforms/compat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_transforms_compat"
repository = "https://github.com/swc-project/swc.git"
version = "0.17.3"
version = "0.17.4"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand Down
Loading

0 comments on commit a1341dc

Please sign in to comment.