Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[babel 8] Enable
allowDeclareFields
option by default with TS (#12461)
- Loading branch information
1 parent
ff52ace
commit 50462eb
Showing
49 changed files
with
557 additions
and
426 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
6 changes: 6 additions & 0 deletions
6
...rties/test/fixtures/compile-to-class/constructor-collision-ignores-types-babel-7/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,6 @@ | ||
class C { | ||
// Output should not use `_initialiseProps` | ||
x: T; | ||
y = 0; | ||
constructor(T) {} | ||
} |
4 changes: 4 additions & 0 deletions
4
...s/test/fixtures/compile-to-class/constructor-collision-ignores-types-babel-7/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,4 @@ | ||
{ | ||
"BABEL_8_BREAKING": false, | ||
"plugins": ["transform-typescript", "proposal-class-properties"] | ||
} |
7 changes: 4 additions & 3 deletions
7
...ss/transform-properties-declare/output.js → ...collision-ignores-types-babel-7/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 |
---|---|---|
@@ -1,8 +1,9 @@ | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
|
||
class A { | ||
constructor() { | ||
_defineProperty(this, "y", void 0); | ||
class C { | ||
// Output should not use `_initialiseProps` | ||
constructor(T) { | ||
_defineProperty(this, "y", 0); | ||
} | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
...test/fixtures/compile-to-class/constructor-collision-ignores-types-loose-babel-7/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,6 @@ | ||
class C { | ||
// Output should not use `_initialiseProps` | ||
x: T; | ||
y = 0; | ||
constructor(T) {} | ||
} |
7 changes: 7 additions & 0 deletions
7
.../fixtures/compile-to-class/constructor-collision-ignores-types-loose-babel-7/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,7 @@ | ||
{ | ||
"BABEL_8_BREAKING": false, | ||
"plugins": [ | ||
"transform-typescript", | ||
["proposal-class-properties", { "loose": true }] | ||
] | ||
} |
7 changes: 7 additions & 0 deletions
7
...est/fixtures/compile-to-class/constructor-collision-ignores-types-loose-babel-7/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,7 @@ | ||
class C { | ||
// Output should not use `_initialiseProps` | ||
constructor(T) { | ||
this.y = 0; | ||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
...ies/test/fixtures/compile-to-class/constructor-collision-ignores-types-loose/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
1 change: 1 addition & 0 deletions
1
...erties/test/fixtures/compile-to-class/constructor-collision-ignores-types-loose/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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
class C { | ||
// Output should not use `_initialiseProps` | ||
constructor(T) { | ||
this.x = void 0; | ||
this.y = 0; | ||
} | ||
|
||
|
1 change: 1 addition & 0 deletions
1
...roperties/test/fixtures/compile-to-class/constructor-collision-ignores-types/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,3 +1,4 @@ | ||
{ | ||
"BABEL_8_BREAKING": true, | ||
"plugins": ["transform-typescript", "proposal-class-properties"] | ||
} |
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
Oops, something went wrong.