decord/source/16486__isNativeReflectConstruct.js

111 lines
3.2 KiB
JavaScript
Raw Normal View History

2026-08-08 06:10:11 +00:00
// Module ID: 16486
// Function ID: 16487
2026-07-29 08:29:29 +00:00
// Name: _isNativeReflectConstruct
2026-08-08 06:10:11 +00:00
// Dependencies: [42, 41, 93, 95, 98, 158, 16487]
2026-07-29 08:29:29 +00:00
2026-08-08 06:10:11 +00:00
// Module 16486 (_isNativeReflectConstruct)
2026-07-29 08:29:29 +00:00
import _createClass from "_createClass";
2026-08-04 21:03:28 +00:00
import _classCallCheck from "_classCallCheck";
import c3 from "_possibleConstructorReturn";
2026-07-29 08:29:29 +00:00
import _getPrototypeOf from "_getPrototypeOf";
import _inherits from "_inherits";
2026-08-04 21:03:28 +00:00
const TimeoutError = require;
2026-07-29 08:29:29 +00:00
function _isNativeReflectConstruct() {
try {
const _Boolean = Boolean;
const call = valueOf.call;
const _Reflect = Reflect;
const _Boolean2 = Boolean;
if (typeof call === "unknown") {
let callResult = valueOf();
} else {
callResult = call(constructResult);
}
let closure_0 = !callResult;
function _isNativeReflectConstruct() {
return closure_0;
}
return _isNativeReflectConstruct();
} catch (err) {
}
}
2026-08-04 21:03:28 +00:00
class TimeoutError {
2026-07-29 08:29:29 +00:00
constructor(arg0) {
self = this;
2026-08-04 21:03:28 +00:00
tmp = outer1_2(this, TimeoutError);
items = [];
items[0] = global;
tmp2 = outer1_4;
obj = outer1_4(TimeoutError);
tmp3 = outer1_3;
2026-07-29 08:29:29 +00:00
if (_isNativeReflectConstruct()) {
tmp5 = globalThis;
_Reflect = Reflect;
2026-08-04 21:03:28 +00:00
constructResult = Reflect.construct(obj, items, tmp2(self).constructor);
2026-07-29 08:29:29 +00:00
} else {
2026-08-04 21:03:28 +00:00
constructResult = obj.apply(self, items);
2026-07-29 08:29:29 +00:00
}
tmp3Result = tmp3(self, constructResult);
2026-08-04 21:03:28 +00:00
tmp3Result.name = "TimeoutError";
return tmp3Result;
2026-07-29 08:29:29 +00:00
}
}
2026-08-04 21:03:28 +00:00
_inherits(TimeoutError, require("_wrapNativeSuper")(Error));
const _moduleResult = _createClass(TimeoutError);
function pTimeout(arg0, arg1, arg2) {
let closure_0 = arg0;
let closure_1 = arg1;
let closure_2 = arg2;
return new Promise((arg0, arg1) => {
const table = arg1;
if (typeof table === "number") {
if (tmp >= 0) {
if (tmp !== Infinity) {
const _setTimeout = setTimeout;
const timeout = setTimeout(() => {
if (typeof closure_2 !== "function") {
const _Error = Error;
if (tmp instanceof Error) {
let tmp8 = tmp;
2026-07-29 08:29:29 +00:00
} else {
2026-08-04 21:03:28 +00:00
tmp8 = outer2_6;
if (typeof tmp === "string") {
let combined = tmp;
} else {
const _HermesInternal = HermesInternal;
combined = "Promise timed out after " + callback + " milliseconds";
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
tmp8 = new tmp8(combined);
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
if (typeof lib.cancel === "function") {
obj.cancel();
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
callback(tmp8);
obj = lib;
} else {
try {
lib(tmp());
} catch (tmp4) {
callback(tmp4);
2026-07-29 08:29:29 +00:00
}
}
2026-08-04 21:03:28 +00:00
}, tmp);
promise(table[6])(promise.then(arg0, arg1), () => {
clearTimeout(closure_2);
2026-07-29 08:29:29 +00:00
});
2026-08-04 21:03:28 +00:00
const tmp7 = promise(table[6]);
} else {
arg0(promise);
2026-07-29 08:29:29 +00:00
}
}
}
2026-08-04 21:03:28 +00:00
const typeError = new TypeError("Expected `milliseconds` to be a positive number");
throw typeError;
});
}
module.exports.default = pTimeout;
module.exports.TimeoutError = _moduleResult;
2026-07-29 08:29:29 +00:00
2026-08-04 21:03:28 +00:00
export default pTimeout;