Justin Ridgewell 0a257e8972
Move more class state out of replaceSupers (#7750)
Yes, the output is uglier. But, this is necessary for me to refactor
`replaceSupers` for #7733, which is necessary for both #7555 and
https://github.com/babel/babel/pull/7553#issuecomment-381434519.

I'm still in the middle of cleaning up all this code. Don't expect
`transformClass` to survive much longer as it's written currently.
2018-04-21 22:56:14 -04:00

41 lines
925 B
JavaScript

"use strict";
var Hello =
/*#__PURE__*/
function () {
function Hello() {
babelHelpers.classCallCheck(this, Hello);
}
babelHelpers.createClass(Hello, [{
key: "toString",
value: function toString() {
return 'hello';
}
}]);
return Hello;
}();
var Outer =
/*#__PURE__*/
function (_Hello) {
function Outer() {
var _this;
babelHelpers.classCallCheck(this, Outer);
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Outer).call(this));
var Inner = {
[babelHelpers.get(babelHelpers.getPrototypeOf(Outer.prototype), "toString", babelHelpers.assertThisInitialized(_this)).call(babelHelpers.assertThisInitialized(_this))]() {
return 'hello';
}
};
return babelHelpers.possibleConstructorReturn(_this, Inner);
}
babelHelpers.inherits(Outer, _Hello);
return Outer;
}(Hello);
expect(new Outer().hello()).toBe('hello');