mirror of
https://github.com/swc-project/swc.git
synced 2024-12-26 07:02:28 +03:00
fix(es/codegen): Ensure decorators are emitted first in TS paramters (#9545)
**Related issue:** - Closes https://github.com/swc-project/swc/issues/9543
This commit is contained in:
parent
6137b897aa
commit
47ef38dc1d
@ -688,11 +688,9 @@ where
|
||||
fn emit_ts_param_prop(&mut self, n: &TsParamProp) -> Result {
|
||||
self.emit_leading_comments_of_span(n.span(), false)?;
|
||||
|
||||
self.emit_accessibility(n.accessibility)?;
|
||||
self.emit_list(n.span, Some(&n.decorators), ListFormat::Decorators)?;
|
||||
|
||||
for dec in &n.decorators {
|
||||
emit!(dec);
|
||||
}
|
||||
self.emit_accessibility(n.accessibility)?;
|
||||
|
||||
if n.is_override {
|
||||
keyword!("override");
|
||||
|
@ -0,0 +1,7 @@
|
||||
export class A {
|
||||
constructor(
|
||||
@IInstantiationService protected readonly _instantiationService: IInstantiationService,
|
||||
@IContainerService private readonly _containerService: IContainerService,
|
||||
) {
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
export class A {
|
||||
constructor(
|
||||
@IInstantiationService
|
||||
protected readonly _instantiationService: IInstantiationService,
|
||||
@IContainerService
|
||||
private readonly _containerService: IContainerService){}
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
import { field__2 } from "../validation/decorators";
|
||||
class C__2 {
|
||||
constructor(@field__2("a")
|
||||
readonly field__3: string, @field__2("b")
|
||||
constructor(
|
||||
@field__2("a")
|
||||
readonly field__3: string,
|
||||
@field__2("b")
|
||||
readonly b__3: string){}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user