mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 04:42:10 +00:00
fix(transformer/typescript): variable declarations are not created when a function has a binding with the same name (#3460)
This commit is contained in:
parent
1a50b86281
commit
b4fd1ad31c
2 changed files with 9 additions and 3 deletions
|
|
@ -207,6 +207,13 @@ impl<'a> TypeScript<'a> {
|
|||
});
|
||||
new_stmts.push(Statement::ClassDeclaration(decl));
|
||||
}
|
||||
Statement::FunctionDeclaration(decl) => {
|
||||
is_empty = false;
|
||||
decl.bound_names(&mut |id| {
|
||||
names.insert(id.name.clone());
|
||||
});
|
||||
new_stmts.push(Statement::FunctionDeclaration(decl));
|
||||
}
|
||||
Statement::TSEnumDeclaration(enum_decl) => {
|
||||
is_empty = false;
|
||||
names.insert(enum_decl.id.name.clone());
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
commit: 4bd1b2c2
|
||||
|
||||
Passed: 479/928
|
||||
Passed: 480/928
|
||||
|
||||
# All Passed:
|
||||
* babel-preset-react
|
||||
|
|
@ -445,12 +445,11 @@ Passed: 479/928
|
|||
* opts/optimizeConstEnums/input.ts
|
||||
* opts/rewriteImportExtensions/input.ts
|
||||
|
||||
# babel-plugin-transform-typescript (135/152)
|
||||
# babel-plugin-transform-typescript (136/152)
|
||||
* enum/mix-references/input.ts
|
||||
* enum/ts5.0-const-foldable/input.ts
|
||||
* exports/declared-types/input.ts
|
||||
* imports/type-only-export-specifier-2/input.ts
|
||||
* namespace/nested/input.ts
|
||||
* optimize-const-enums/custom-values/input.ts
|
||||
* optimize-const-enums/custom-values-exported/input.ts
|
||||
* optimize-const-enums/declare/input.ts
|
||||
|
|
|
|||
Loading…
Reference in a new issue