mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
fix(transformer/typescript): generated assignment for constructor arguments with access modifiers should be injected to the top of the constructor (#4808)
fix: #4789
This commit is contained in:
parent
857bc73302
commit
62f759c1f2
3 changed files with 4 additions and 2 deletions
|
|
@ -298,7 +298,8 @@ impl<'a> TypeScriptAnnotations<'a> {
|
|||
)
|
||||
})
|
||||
.statements
|
||||
.extend(
|
||||
.splice(
|
||||
0..0,
|
||||
self.assignments
|
||||
.drain(..)
|
||||
.map(|assignment| assignment.create_this_property_assignment(ctx)),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
class Foo {
|
||||
boom: number;
|
||||
constructor(public foo, private bar, protected zoo, readonly bang, too) {
|
||||
|
||||
console.log(this.foo, this.bar, this.zoo, this.bang);
|
||||
}
|
||||
}
|
||||
class Bar extends Foo {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ class Foo {
|
|||
this.bar = bar;
|
||||
this.zoo = zoo;
|
||||
this.bang = bang;
|
||||
console.log(this.foo, this.bar, this.zoo, this.bang);
|
||||
}
|
||||
}
|
||||
class Bar extends Foo {
|
||||
|
|
|
|||
Loading…
Reference in a new issue