decord/source/5_asyncGeneratorStep.js

42 lines
1.1 KiB
JavaScript
Raw Normal View History

2026-07-20 16:05:17 +00:00
// Module ID: 5
2026-07-29 08:29:29 +00:00
// Function ID: 6
2026-07-20 16:05:17 +00:00
// Name: asyncGeneratorStep
// Dependencies: []
// Module 5 (asyncGeneratorStep)
function asyncGeneratorStep(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
2026-07-29 08:29:29 +00:00
try {
const iter = arg0[arg5](arg6);
const value = iter.value;
if (iter.done) {
arg1(value);
} else {
const resolved = Promise.resolve(value);
resolved.then(arg3, arg4);
}
} catch (tmp13) {
arg2(tmp13);
2026-07-20 16:05:17 +00:00
}
}
export default function _asyncToGenerator(arg0) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
2026-07-20 16:05:17 +00:00
return function() {
2026-07-23 10:11:24 +00:00
const self = this;
2026-07-20 16:05:17 +00:00
let closure_1 = arguments;
return new Promise((arg0, arg1) => {
2026-07-29 08:29:29 +00:00
const _self = arg0;
2026-07-20 16:05:17 +00:00
let closure_1 = arg1;
function _next(arg0) {
2026-07-23 10:11:24 +00:00
callback(closure_2, callback, closure_1, _next, _throw, "next", arg0);
2026-07-20 16:05:17 +00:00
}
function _throw(arg0) {
2026-07-23 10:11:24 +00:00
callback(closure_2, callback, closure_1, _next, _throw, "throw", arg0);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const applyResult = self.apply(_self, closure_1);
let closure_2 = applyResult;
_self(applyResult, arg0, arg1, _next, _throw, "next", undefined);
2026-07-20 16:05:17 +00:00
});
};
};