main
Last change
on this file since 65b6638 was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
564 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | import setPrototypeOf from "./setPrototypeOf.js";
|
---|
| 2 | export default function _inherits(subClass, superClass) {
|
---|
| 3 | if (typeof superClass !== "function" && superClass !== null) {
|
---|
| 4 | throw new TypeError("Super expression must either be null or a function");
|
---|
| 5 | }
|
---|
| 6 | subClass.prototype = Object.create(superClass && superClass.prototype, {
|
---|
| 7 | constructor: {
|
---|
| 8 | value: subClass,
|
---|
| 9 | writable: true,
|
---|
| 10 | configurable: true
|
---|
| 11 | }
|
---|
| 12 | });
|
---|
| 13 | Object.defineProperty(subClass, "prototype", {
|
---|
| 14 | writable: false
|
---|
| 15 | });
|
---|
| 16 | if (superClass) setPrototypeOf(subClass, superClass);
|
---|
| 17 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.