Last change
on this file since bdd6491 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
682 bytes
|
Line | |
---|
1 | import getPrototypeOf from "./getPrototypeOf.js";
|
---|
2 | import isNativeReflectConstruct from "./isNativeReflectConstruct.js";
|
---|
3 | import possibleConstructorReturn from "./possibleConstructorReturn.js";
|
---|
4 | export default function _createSuper(Derived) {
|
---|
5 | var hasNativeReflectConstruct = isNativeReflectConstruct();
|
---|
6 | return function _createSuperInternal() {
|
---|
7 | var Super = getPrototypeOf(Derived),
|
---|
8 | result;
|
---|
9 |
|
---|
10 | if (hasNativeReflectConstruct) {
|
---|
11 | var NewTarget = getPrototypeOf(this).constructor;
|
---|
12 | result = Reflect.construct(Super, arguments, NewTarget);
|
---|
13 | } else {
|
---|
14 | result = Super.apply(this, arguments);
|
---|
15 | }
|
---|
16 |
|
---|
17 | return possibleConstructorReturn(this, result);
|
---|
18 | };
|
---|
19 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.