decord/source/4273_timeout.js

44 lines
1 KiB
JavaScript
Raw Normal View History

2026-07-23 10:11:24 +00:00
// Module ID: 4273
// Function ID: 37399
2026-07-20 16:05:17 +00:00
// Name: timeout
// Dependencies: []
2026-07-23 10:11:24 +00:00
// Module 4273 (timeout)
2026-07-20 16:05:17 +00:00
exports.exports.timeout = (arg0, arg1) => {
2026-07-23 10:11:24 +00:00
let closure_0 = arg1;
let closure_2 = new closure_0();
const items = [arg0, ];
const tmp = new closure_0();
items[1] = new Promise((arg0, arg1) => {
let closure_0 = arg1;
const timeout = setTimeout(() => {
callback(outer1_2);
}, closure_0);
});
2026-07-20 16:05:17 +00:00
const promise = new Promise((arg0, arg1) => {
2026-07-23 10:11:24 +00:00
let closure_0 = arg1;
2026-07-20 16:05:17 +00:00
const timeout = setTimeout(() => {
2026-07-23 10:11:24 +00:00
callback(outer1_2);
}, closure_0);
2026-07-20 16:05:17 +00:00
});
return Promise.race(items).then((arg0) => {
clearTimeout(closure_1);
return arg0;
}, (arg0) => {
clearTimeout(closure_1);
throw arg0;
});
};
class tmp {
constructor() {
callResult = Error.call(this);
this.stack = Error().stack;
this.message = "Timeout";
return;
}
}
exports.exports.TimeoutError = tmp;
2026-07-23 10:11:24 +00:00
let closure_0 = tmp;
2026-07-20 16:05:17 +00:00
tmp.prototype = Object.create(Error.prototype);
tmp.prototype.name = "TimeoutError";