forked from babel/babel
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
retain method return types on transform-es2015-classes (closes babel#…
- Loading branch information
Showing
20 changed files
with
144 additions
and
0 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
6 changes: 6 additions & 0 deletions
6
...ugin-transform-es2015-classes/test/fixtures/loose/method-return-type-annotation/actual.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 @@ | ||
// @flow | ||
class C { | ||
m(x: number): string { | ||
return 'a'; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...in-transform-es2015-classes/test/fixtures/loose/method-return-type-annotation/expected.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,12 @@ | ||
// @flow | ||
var C = function () { | ||
function C() { | ||
babelHelpers.classCallCheck(this, C); | ||
} | ||
|
||
C.prototype.m = function m(x: number): string { | ||
return 'a'; | ||
}; | ||
|
||
return C; | ||
}(); |
3 changes: 3 additions & 0 deletions
3
...n-transform-es2015-classes/test/fixtures/loose/method-return-type-annotation/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": ["external-helpers", "transform-es2015-function-name", ["transform-es2015-classes", { "loose": true }], "transform-es2015-spread", "transform-es2015-block-scoping", "syntax-flow"] | ||
} |
6 changes: 6 additions & 0 deletions
6
...lugin-transform-es2015-classes/test/fixtures/spec/method-return-type-annotation/actual.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 @@ | ||
// @flow | ||
class C { | ||
m(x: number): string { | ||
return 'a'; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...gin-transform-es2015-classes/test/fixtures/spec/method-return-type-annotation/expected.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 @@ | ||
// @flow | ||
var C = function () { | ||
function C() { | ||
babelHelpers.classCallCheck(this, C); | ||
} | ||
|
||
babelHelpers.createClass(C, [{ | ||
key: 'm', | ||
value: function m(x: number): string { | ||
return 'a'; | ||
} | ||
}]); | ||
return C; | ||
}(); |
3 changes: 3 additions & 0 deletions
3
...in-transform-es2015-classes/test/fixtures/spec/method-return-type-annotation/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": ["external-helpers", "transform-es2015-function-name", "transform-es2015-classes", "transform-es2015-spread", "transform-es2015-block-scoping", "syntax-flow"] | ||
} |
6 changes: 6 additions & 0 deletions
6
...st/fixtures/flow-comments/transformed-class-method-loose-return-type-annotation/actual.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 @@ | ||
// @flow | ||
class C { | ||
m(x: number): string { | ||
return 'a'; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
.../fixtures/flow-comments/transformed-class-method-loose-return-type-annotation/expected.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 @@ | ||
'use strict'; | ||
|
||
// @flow | ||
var C = function () { | ||
function C() { | ||
babelHelpers.classCallCheck(this, C); | ||
} | ||
|
||
C.prototype.m = function m(x /*: number*/) /*: string*/ { | ||
return 'a'; | ||
}; | ||
|
||
return C; | ||
}(); |
4 changes: 4 additions & 0 deletions
4
...fixtures/flow-comments/transformed-class-method-loose-return-type-annotation/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 @@ | ||
{ | ||
"presets": [["es2015", { "loose": true }]], | ||
"plugins": ["transform-flow-comments", "external-helpers"] | ||
} |
6 changes: 6 additions & 0 deletions
6
...nts/test/fixtures/flow-comments/transformed-class-method-return-type-annotation/actual.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 @@ | ||
// @flow | ||
class C { | ||
m(x: number): string { | ||
return 'a'; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...s/test/fixtures/flow-comments/transformed-class-method-return-type-annotation/expected.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,16 @@ | ||
'use strict'; | ||
|
||
// @flow | ||
var C = function () { | ||
function C() { | ||
babelHelpers.classCallCheck(this, C); | ||
} | ||
|
||
babelHelpers.createClass(C, [{ | ||
key: 'm', | ||
value: function m(x /*: number*/) /*: string*/ { | ||
return 'a'; | ||
} | ||
}]); | ||
return C; | ||
}(); |
4 changes: 4 additions & 0 deletions
4
.../test/fixtures/flow-comments/transformed-class-method-return-type-annotation/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 @@ | ||
{ | ||
"presets": ["es2015"], | ||
"plugins": ["transform-flow-comments", "external-helpers"] | ||
} |
6 changes: 6 additions & 0 deletions
6
.../test/fixtures/regression/transformed-class-method-loose-return-type-annotation/actual.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 @@ | ||
// @flow | ||
class C { | ||
m(x: number): string { | ||
return 'a'; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...est/fixtures/regression/transformed-class-method-loose-return-type-annotation/expected.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,13 @@ | ||
'use strict'; | ||
|
||
var C = function () { | ||
function C() { | ||
babelHelpers.classCallCheck(this, C); | ||
} | ||
|
||
C.prototype.m = function m(x) { | ||
return 'a'; | ||
}; | ||
|
||
return C; | ||
}(); |
4 changes: 4 additions & 0 deletions
4
...st/fixtures/regression/transformed-class-method-loose-return-type-annotation/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 @@ | ||
{ | ||
"presets": [["es2015", { "loose": true }]], | ||
"plugins": ["transform-flow-strip-types", "external-helpers"] | ||
} |
6 changes: 6 additions & 0 deletions
6
...-types/test/fixtures/regression/transformed-class-method-return-type-annotation/actual.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 @@ | ||
// @flow | ||
class C { | ||
m(x: number): string { | ||
return 'a'; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...ypes/test/fixtures/regression/transformed-class-method-return-type-annotation/expected.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,15 @@ | ||
'use strict'; | ||
|
||
var C = function () { | ||
function C() { | ||
babelHelpers.classCallCheck(this, C); | ||
} | ||
|
||
babelHelpers.createClass(C, [{ | ||
key: 'm', | ||
value: function m(x) { | ||
return 'a'; | ||
} | ||
}]); | ||
return C; | ||
}(); |
4 changes: 4 additions & 0 deletions
4
...pes/test/fixtures/regression/transformed-class-method-return-type-annotation/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 @@ | ||
{ | ||
"presets": ["es2015"], | ||
"plugins": ["transform-flow-strip-types", "external-helpers"] | ||
} |