Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: issue 6219 #6250

Merged
merged 3 commits into from Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions crates/swc_ecma_transforms_typescript/src/strip.rs
Expand Up @@ -594,12 +594,6 @@ where
if let Some(Some(v)) = values.get(&id.sym) {
return Ok(v.clone());
}
//
kdy1 marked this conversation as resolved.
Show resolved Hide resolved
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) => {
Expand Down
13 changes: 13 additions & 0 deletions crates/swc_ecma_transforms_typescript/tests/strip.rs
Expand Up @@ -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 = {}))"#
);