Skip to content

Commit

Permalink
bundler: fix extra bugs (#1127)
Browse files Browse the repository at this point in the history
swc_bundler:
 - Prevent invalid output like `export * as helpers`
 - Prevent stack overflow which occurs while bundling `https://deno.land/x/oak@v6.2.0/mod.ts`

swc_ecma_transforms:
 - Migrate inlining pass to VisitMut
  • Loading branch information
kdy1 authored Oct 3, 2020
1 parent e4b8a0c commit 205ce4e
Show file tree
Hide file tree
Showing 4 changed files with 164 additions and 203 deletions.
2 changes: 1 addition & 1 deletion ecmascript/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ swc_ecma_ast = {version = "0.32.0", path = "./ast"}
swc_ecma_codegen = {version = "0.36.0", path = "./codegen", optional = true}
swc_ecma_dep_graph = {version = "0.4.0", path = "./dep-graph", optional = true}
swc_ecma_parser = {version = "0.38.0", path = "./parser", optional = true}
swc_ecma_transforms = {version = "0.24.1", path = "./transforms", optional = true}
swc_ecma_transforms = {version = "0.24.4", path = "./transforms", optional = true}
swc_ecma_utils = {version = "0.22.0", path = "./utils", optional = true}
swc_ecma_visit = {version = "0.18.0", path = "./visit", optional = true}

Expand Down
6 changes: 6 additions & 0 deletions ecmascript/transforms/src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ impl MapWithMut for ObjectPatProp {
}
}

impl MapWithMut for PatOrExpr {
fn dummy() -> Self {
PatOrExpr::Pat(Box::new(Pat::Ident(Ident::dummy())))
}
}

pub(crate) trait PatOrExprExt: AsOptExpr {
fn as_ref(&self) -> &PatOrExpr;
fn as_mut(&mut self) -> &mut PatOrExpr;
Expand Down
Loading

0 comments on commit 205ce4e

Please sign in to comment.