1 | var _Map = require("core-js-pure/features/map/index.js");
|
---|
2 | var _Object$create = require("core-js-pure/features/object/create.js");
|
---|
3 | var getPrototypeOf = require("./getPrototypeOf.js");
|
---|
4 | var setPrototypeOf = require("./setPrototypeOf.js");
|
---|
5 | var isNativeFunction = require("./isNativeFunction.js");
|
---|
6 | var construct = require("./construct.js");
|
---|
7 | function _wrapNativeSuper(Class) {
|
---|
8 | var _cache = typeof _Map === "function" ? new _Map() : undefined;
|
---|
9 | module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
|
---|
10 | if (Class === null || !isNativeFunction(Class)) return Class;
|
---|
11 | if (typeof Class !== "function") {
|
---|
12 | throw new TypeError("Super expression must either be null or a function");
|
---|
13 | }
|
---|
14 | if (typeof _cache !== "undefined") {
|
---|
15 | if (_cache.has(Class)) return _cache.get(Class);
|
---|
16 | _cache.set(Class, Wrapper);
|
---|
17 | }
|
---|
18 | function Wrapper() {
|
---|
19 | return construct(Class, arguments, getPrototypeOf(this).constructor);
|
---|
20 | }
|
---|
21 | Wrapper.prototype = _Object$create(Class.prototype, {
|
---|
22 | constructor: {
|
---|
23 | value: Wrapper,
|
---|
24 | enumerable: false,
|
---|
25 | writable: true,
|
---|
26 | configurable: true
|
---|
27 | }
|
---|
28 | });
|
---|
29 | return setPrototypeOf(Wrapper, Class);
|
---|
30 | }, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
---|
31 | return _wrapNativeSuper(Class);
|
---|
32 | }
|
---|
33 | module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports; |
---|