Speed up the createSuper helper (#11401)
This commit is contained in:
@@ -742,9 +742,11 @@ helpers.createSuper = helper("7.9.0")`
|
||||
import possibleConstructorReturn from "possibleConstructorReturn";
|
||||
|
||||
export default function _createSuper(Derived) {
|
||||
var hasNativeReflectConstruct = isNativeReflectConstruct();
|
||||
|
||||
return function () {
|
||||
var Super = getPrototypeOf(Derived), result;
|
||||
if (isNativeReflectConstruct()) {
|
||||
if (hasNativeReflectConstruct) {
|
||||
// NOTE: This doesn't work if this.__proto__.constructor has been modified.
|
||||
var NewTarget = getPrototypeOf(this).constructor;
|
||||
result = Reflect.construct(Super, arguments, NewTarget);
|
||||
|
||||
Reference in New Issue
Block a user