Justin Ridgewell f8ab9466d3
Move subclass inheritance to end (#7772)
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.
2018-04-21 17:31:44 -04:00

25 lines
648 B
JavaScript

function _inheritsLoose(subClass, superClass) { subClass.prototype.__proto__ = superClass && superClass.prototype; subClass.__proto__ = superClass; }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
let B = function B() {
"use strict";
};
let A =
/*#__PURE__*/
function (_B) {
"use strict";
function A(track) {
var _this;
if (track !== undefined) _this = _B.call(this, track) || this;else _this = _B.call(this) || this;
return _assertThisInitialized(_this);
}
_inheritsLoose(A, _B);
return A;
}(B);