Skip to content

Commit 2640e5a

Browse files
JLHwungexistentialism
authored andcommitted
fix: remove accessibility of constructor (#10658)
1 parent 0f94999 commit 2640e5a

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

packages/babel-plugin-transform-typescript/src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export default declare(
9393
// Rest handled by Function visitor
9494
},
9595
constructor(path, classPath) {
96+
if (path.node.accessibility) path.node.accessibility = null;
9697
// Collects parameter properties so that we can add an assignment
9798
// for each of them in the constructor body
9899
//
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
class C {
22
m(): void;
33
public m(x?: number, ...y: number[]): void {}
4+
public constructor() {}
45
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
class C {
22
m(x, ...y) {}
33

4+
constructor() {}
5+
46
}

0 commit comments

Comments
 (0)