retain method return types on transform-es2015-classes (closes #4665) (#4668)

This commit is contained in:
Dan Harper
2016-10-04 23:22:29 +01:00
committed by Henry Zhu
parent fc54264f70
commit 7f772e94ce
20 changed files with 144 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
// @flow
class C {
m(x: number): string {
return 'a';
}
}

View File

@@ -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;
}();

View File

@@ -0,0 +1,4 @@
{
"presets": [["es2015", { "loose": true }]],
"plugins": ["transform-flow-comments", "external-helpers"]
}

View File

@@ -0,0 +1,6 @@
// @flow
class C {
m(x: number): string {
return 'a';
}
}

View File

@@ -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;
}();

View File

@@ -0,0 +1,4 @@
{
"presets": ["es2015"],
"plugins": ["transform-flow-comments", "external-helpers"]
}