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