diff --git a/crates/swc_ecma_transforms_typescript/src/strip.rs b/crates/swc_ecma_transforms_typescript/src/strip.rs index ea8f6d9839de..923290b8ac2c 100644 --- a/crates/swc_ecma_transforms_typescript/src/strip.rs +++ b/crates/swc_ecma_transforms_typescript/src/strip.rs @@ -594,12 +594,6 @@ where if let Some(Some(v)) = values.get(&id.sym) { return Ok(v.clone()); } - // - for m in e.members.iter() { - if &id.sym == m.id.as_ref() { - return compute(e, span, values, None, m.init.as_deref()); - } - } return Err(()); } Expr::Unary(ref expr) => { diff --git a/crates/swc_ecma_transforms_typescript/tests/strip.rs b/crates/swc_ecma_transforms_typescript/tests/strip.rs index eaaa85474441..5078959aea80 100644 --- a/crates/swc_ecma_transforms_typescript/tests/strip.rs +++ b/crates/swc_ecma_transforms_typescript/tests/strip.rs @@ -4655,3 +4655,16 @@ test_with_config!( } " ); + +test!( + ::swc_ecma_parser::Syntax::Typescript(Default::default()), + |_| tr(), + issue_6219, + "enum A{ + a=a, + }", + r#"var A; + (function(A) { + A[A["a"] = a] = "a"; + })(A || (A = {}))"# +);