decord/source/98__inherits.js
2026-08-24 06:08:38 +00:00

27 lines
722 B
JavaScript

// Module ID: 98
// Function ID: 99
// Name: _inherits
// Dependencies: [99]
// Module 98 (_inherits)
import _setPrototypeOf from "_setPrototypeOf" /* 99 */;
export default function _inherits(value, fn) {
if (typeof fn !== "function") {
if (null !== fn) {
const _TypeError = TypeError;
const typeError = new TypeError("Super expression must either be null or a function");
throw typeError;
}
}
let prototype = fn;
if (fn) {
prototype = fn.prototype;
}
value.prototype = Object.create(prototype, { constructor: { value, writable: true, configurable: true } });
Object.defineProperty(value, "prototype", { writable: false });
if (fn) {
_setPrototypeOf(value, fn);
}
};