decord/source/98__inherits.js

26 lines
683 B
JavaScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 98
// Function ID: 99
2026-07-20 16:05:17 +00:00
// Name: _inherits
2026-07-29 08:29:29 +00:00
// Dependencies: [99]
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
// Module 98 (_inherits)
2026-07-20 16:05:17 +00:00
2026-08-04 21:03:28 +00:00
export default function _inherits(value, fn) {
if (typeof fn !== "function") {
if (null !== fn) {
2026-07-20 16:05:17 +00:00
const _TypeError = TypeError;
const typeError = new TypeError("Super expression must either be null or a function");
throw typeError;
}
}
2026-08-04 21:03:28 +00:00
let prototype = fn;
if (fn) {
prototype = fn.prototype;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
value.prototype = Object.create(prototype, { constructor: { value, writable: true, configurable: true } });
2026-07-20 16:05:17 +00:00
Object.defineProperty(value, "prototype", { writable: false });
2026-08-04 21:03:28 +00:00
if (fn) {
require(99) /* _setPrototypeOf */(value, fn);
2026-07-20 16:05:17 +00:00
}
};