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