Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
injectInitialization
to generate ts parameter properties (#9610)
- Loading branch information
1 parent
58cf1a7
commit 87fb6c4
Showing
6 changed files
with
35 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...-plugin-transform-typescript/test/fixtures/class/parameter-properties-late-super/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class B extends A { | ||
constructor(public p: string) { | ||
console.log('anything before super'); | ||
if (p) super(); | ||
else { | ||
super(); | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...gin-transform-typescript/test/fixtures/class/parameter-properties-late-super/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"plugins": ["transform-typescript"] | ||
} |
14 changes: 14 additions & 0 deletions
14
...plugin-transform-typescript/test/fixtures/class/parameter-properties-late-super/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class B extends A { | ||
constructor(p) { | ||
console.log('anything before super'); | ||
|
||
if (p) { | ||
super(); | ||
this.p = p; | ||
} else { | ||
super(); | ||
this.p = p; | ||
} | ||
} | ||
|
||
} |