main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[d565449] | 1 | var getPrototypeOf = require("./getPrototypeOf.js");
|
---|
| 2 | var setPrototypeOf = require("./setPrototypeOf.js");
|
---|
| 3 | var isNativeFunction = require("./isNativeFunction.js");
|
---|
| 4 | var construct = require("./construct.js");
|
---|
| 5 | function _wrapNativeSuper(t) {
|
---|
| 6 | var r = "function" == typeof Map ? new Map() : void 0;
|
---|
| 7 | return (module.exports = _wrapNativeSuper = function _wrapNativeSuper(t) {
|
---|
| 8 | if (null === t || !isNativeFunction(t)) return t;
|
---|
| 9 | if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
|
---|
| 10 | if (void 0 !== r) {
|
---|
| 11 | if (r.has(t)) return r.get(t);
|
---|
| 12 | r.set(t, Wrapper);
|
---|
| 13 | }
|
---|
| 14 | function Wrapper() {
|
---|
| 15 | return construct(t, arguments, getPrototypeOf(this).constructor);
|
---|
| 16 | }
|
---|
| 17 | return Wrapper.prototype = Object.create(t.prototype, {
|
---|
| 18 | constructor: {
|
---|
| 19 | value: Wrapper,
|
---|
| 20 | enumerable: !1,
|
---|
| 21 | writable: !0,
|
---|
| 22 | configurable: !0
|
---|
| 23 | }
|
---|
| 24 | }), setPrototypeOf(Wrapper, t);
|
---|
| 25 | }, module.exports.__esModule = true, module.exports["default"] = module.exports), _wrapNativeSuper(t);
|
---|
| 26 | }
|
---|
| 27 | module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports; |
---|
Note:
See
TracBrowser
for help on using the repository browser.