We were using `Object.create` to setup the prototype chain at the start of the class definition, which lead to #7771. I was a bit worried about a speed hit, but it seems everyone optimizes the two patterns the same way. https://jsbench.github.io/#f9fca52407643d96458a35763b201215 Fixes #7771.
30 lines
754 B
JavaScript
30 lines
754 B
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
|
|
var _BaseFoo2 = babelHelpers.interopRequireDefault(require("./BaseFoo"));
|
|
|
|
var SubFoo =
|
|
/*#__PURE__*/
|
|
function (_BaseFoo) {
|
|
function SubFoo() {
|
|
babelHelpers.classCallCheck(this, SubFoo);
|
|
return babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(SubFoo).apply(this, arguments));
|
|
}
|
|
|
|
babelHelpers.createClass(SubFoo, null, [{
|
|
key: "talk",
|
|
value: function talk() {
|
|
babelHelpers.get(babelHelpers.getPrototypeOf(SubFoo), "talk", this).call(this);
|
|
console.log('SubFoo.talk');
|
|
}
|
|
}]);
|
|
babelHelpers.inherits(SubFoo, _BaseFoo);
|
|
return SubFoo;
|
|
}(_BaseFoo2.default);
|
|
|
|
exports.default = SubFoo;
|