mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
fix(codegen): missing TypeParameters in TSConstructSignature (#4063)
This commit is contained in:
parent
1b8f208572
commit
564a75ab37
2 changed files with 4 additions and 0 deletions
|
|
@ -3106,6 +3106,9 @@ impl<'a, const MINIFY: bool> Gen<MINIFY> for TSSignature<'a> {
|
||||||
}
|
}
|
||||||
Self::TSConstructSignatureDeclaration(signature) => {
|
Self::TSConstructSignatureDeclaration(signature) => {
|
||||||
p.print_str(b"new ");
|
p.print_str(b"new ");
|
||||||
|
if let Some(type_parameters) = signature.type_parameters.as_ref() {
|
||||||
|
type_parameters.gen(p, ctx);
|
||||||
|
}
|
||||||
p.print_str(b"(");
|
p.print_str(b"(");
|
||||||
signature.params.gen(p, ctx);
|
signature.params.gen(p, ctx);
|
||||||
p.print_str(b")");
|
p.print_str(b")");
|
||||||
|
|
|
||||||
|
|
@ -200,6 +200,7 @@ fn typescript() {
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
test_ts("let foo: { <T>(t: T): void }", "let foo: {<T>(t: T): void};\n", false);
|
test_ts("let foo: { <T>(t: T): void }", "let foo: {<T>(t: T): void};\n", false);
|
||||||
|
test_ts("let foo: { new <T>(t: T): void }", "let foo: {new <T>(t: T): void};\n", false);
|
||||||
test_ts("function <const T>(){}", "function<const T>() {}\n", false);
|
test_ts("function <const T>(){}", "function<const T>() {}\n", false);
|
||||||
test_ts("class A {m?(): void}", "class A {\n\tm?(): void;\n}\n", false);
|
test_ts("class A {m?(): void}", "class A {\n\tm?(): void;\n}\n", false);
|
||||||
test_ts(
|
test_ts(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue