decord/source/__polyfill/01xxx/module_1593.js
github-actions e510164e6b chore: update source for alpha 346.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4759.js (118.4 MB)
2026-09-10 05:38:07 +00:00

113 lines
3 KiB
JavaScript

// Module ID: 1593
// Function ID: 1594
// Dependencies: [5, 32, 19]
// Exports: useThenable
// Module 1593
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
import _slicedToArray from "module_32" /* 32 */;
import noop from "module_19" /* 19 */;
export const useThenable = function useThenable(arg0) {
const first = items(noop.useState(arg0), 1)[0];
items = [false, undefined];
first.then((result) => {
items = [true, result];
});
[tmp3, noop] = items(noop.useState(items), 2);
const first1 = items(tmp3, 1)[0];
let items1 = [first, first1];
const effect = noop.useEffect(() => {
c0 = first(function*(arg0, value) {
if (c5 === 2) {
c5 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
} else if (tmp6 === 3) {
if (arg0 === 1) {
throw value;
} else if (arg0 === 2) {
const obj2 = { value, done: true };
return obj2;
} else {
return { value: "HermesInternal", done: null };
}
} else {
try {
c5 = 2;
if (0 === c4) {
if (arg0 === 1) {
c5 = 3;
throw value;
} else if (arg0 === 2) {
c5 = 3;
const obj3 = { value, done: true };
return obj3;
} else {
closure_1 = tmp3;
closure_0 = tmp7;
closure_128_0 = undefined;
c3 = 1;
c4 = 2;
c5 = 1;
const obj4 = { value, done: false };
return obj4;
}
} else if (1 === tmp7) {
c3 = 0;
if (!closure_0) {
items = [true, closure_128_0];
noop(items);
}
throw closure_2;
} else if (arg0 === 1) {
c5 = 3;
throw value;
} else if (arg0 === 2) {
c3 = 0;
if (!closure_0) {
const items1 = [true, closure_128_0];
noop(items1);
}
c5 = 3;
const obj = { value, done: true };
return obj;
} else {
closure_128_0 = value;
c3 = 0;
if (!closure_0) {
const items2 = [true, closure_128_0];
noop(items2);
}
c5 = 3;
return { value: "HermesInternal", done: null };
}
} catch (tmp28) {
closure_2 = tmp28;
if (tmp4 === c3) {
c5 = tmp2;
throw tmp28;
} else {
c4 = tmp;
}
}
}
});
if (!first1) {
(function resolve() {
const self = this;
const apply = c0.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
})();
}
return () => {
c0 = true;
};
}, items1);
return tmp3;
};