tangshi300/@babel/runtime/helpers/asyncToGenerator.js

25 lines
659 B
JavaScript

function n(n, t, r, e, o, i, u) {
try {
var c = n[i](u), s = c.value;
} catch (n) {
n = VM2_INTERNAL_STATE_DO_NOT_USE_OR_PROGRAM_WILL_FAIL.handleException(n);
return void r(n);
}
c.done ? t(s) : Promise.resolve(s).then(e, o);
}
module.exports = function(t) {
return function() {
var r = this, e = arguments;
return new Promise(function(o, i) {
var u = t.apply(r, e);
function c(t) {
n(u, o, i, c, s, "next", t);
}
function s(t) {
n(u, o, i, c, s, "throw", t);
}
c(void 0);
});
};
};