Fix returning an object in a derived class constructor without super (#5885)

This commit is contained in:
Justin Ridgewell
2017-07-11 17:43:19 -04:00
committed by Henry Zhu
parent 960e1708a1
commit e170e6d760
26 changed files with 165 additions and 103 deletions

View File

@@ -7,10 +7,10 @@ var Foo = function (_Bar) {
babelHelpers.inherits(Foo, _Bar);
function Foo() {
var _this;
babelHelpers.classCallCheck(this, Foo);
var _this = babelHelpers.possibleConstructorReturn(this, (Foo.__proto__ || Object.getPrototypeOf(Foo)).call(this));
_this = babelHelpers.possibleConstructorReturn(this, (Foo.__proto__ || Object.getPrototypeOf(Foo)).call(this));
_this.state = "test";
return _this;
}