decord/source/4635_timeout.js

63 lines
1.3 KiB
JavaScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 4635
// Function ID: 4636
2026-07-29 08:29:29 +00:00
// Name: timeout
// Dependencies: []
2026-08-24 06:08:38 +00:00
// Module 4635 (timeout)
2026-07-29 08:29:29 +00:00
exports.exports.timeout = (arg0, arg1) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg1;
2026-08-04 21:03:28 +00:00
if (typeof closure_0 !== "function") {
2026-07-29 08:29:29 +00:00
HermesBuiltin.throwTypeError();
}
const _Error = Error;
if (typeof call === "unknown") {
_Error();
} else {
call(tmp);
}
new.target.stack = Error().stack;
new.target.message = "Timeout";
2026-08-24 06:08:38 +00:00
closure_2 = tmp;
2026-07-29 08:29:29 +00:00
const items = [
arg0,
new Promise((arg0, arg1) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg1;
2026-07-29 08:29:29 +00:00
const timeout = setTimeout(() => {
2026-08-24 06:08:38 +00:00
callback(closure_1_2);
2026-07-29 08:29:29 +00:00
}, closure_0);
})
];
const promise = new Promise((arg0, arg1) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg1;
2026-07-29 08:29:29 +00:00
const timeout = setTimeout(() => {
2026-08-24 06:08:38 +00:00
callback(closure_1_2);
2026-07-29 08:29:29 +00:00
}, closure_0);
});
return Promise.race(items).then((arg0) => {
clearTimeout(closure_1);
return arg0;
}, (arg0) => {
clearTimeout(closure_1);
throw arg0;
});
};
class tmp {
constructor() {
self = this;
_Error = Error;
call = Error.call;
if (typeof call === "unknown") {
_ErrorResult = _Error();
} else {
callResult = call(self);
}
self.stack = Error().stack;
self.message = "Timeout";
return;
}
}
exports.exports.TimeoutError = tmp;
let c0 = tmp;
tmp.prototype = Object.create(Error.prototype);
tmp.prototype.name = "TimeoutError";