-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid removing uninitialized class fields with flow (#10120)
* flow avoid removing class fields * fix test case * Update test Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
- Loading branch information
1 parent
2eeb349
commit 635c7fd
Showing
10 changed files
with
21 additions
and
13 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
1 change: 0 additions & 1 deletion
1
...res/regression/class-prop-values/input.js → ...ression/class-fields-initialized/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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
class X { | ||
foo = 2 | ||
bar: number = 3 | ||
baz: ?string | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../regression/class-prop-types/options.json → ...n/class-fields-uninitialized/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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"plugins": [ | ||
"transform-flow-strip-types", | ||
"transform-classes", | ||
"proposal-class-properties", | ||
"external-helpers" | ||
] | ||
} |
6 changes: 6 additions & 0 deletions
6
...-transform-flow-strip-types/test/fixtures/regression/class-fields-uninitialized/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,6 @@ | ||
class Test { | ||
constructor() { | ||
babelHelpers.defineProperty(this, "prop", void 0); | ||
} | ||
|
||
} |
5 changes: 0 additions & 5 deletions
5
...bel-plugin-transform-flow-strip-types/test/fixtures/regression/class-prop-types/output.js
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -2,6 +2,10 @@ class C1 {} | |
|
||
function f() {} | ||
|
||
class C2 {} | ||
class C2 { | ||
p; | ||
} | ||
|
||
class C3 {} | ||
class C3 { | ||
p; | ||
} |
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