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.
24 lines
581 B
JavaScript
24 lines
581 B
JavaScript
function broken(x) {
|
|
if (true) {
|
|
var Foo =
|
|
/*#__PURE__*/
|
|
function (_Bar) {
|
|
"use strict";
|
|
|
|
function Foo() {
|
|
babelHelpers.classCallCheck(this, Foo);
|
|
return babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).apply(this, arguments));
|
|
}
|
|
|
|
babelHelpers.inherits(Foo, _Bar);
|
|
return Foo;
|
|
}(Bar);
|
|
|
|
for (var _len = arguments.length, foo = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
foo[_key - 1] = arguments[_key];
|
|
}
|
|
|
|
return hello.apply(void 0, foo);
|
|
}
|
|
}
|