|
|
|
|
@ -53,8 +53,6 @@ export function flatten(blockers, sync, async, fn) {
|
|
|
|
|
|
|
|
|
|
var restore = capture();
|
|
|
|
|
|
|
|
|
|
var was_hydrating = hydrating;
|
|
|
|
|
|
|
|
|
|
function run() {
|
|
|
|
|
Promise.all(async.map((expression) => async_derived(expression)))
|
|
|
|
|
.then((result) => {
|
|
|
|
|
@ -69,10 +67,6 @@ export function flatten(blockers, sync, async, fn) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (was_hydrating) {
|
|
|
|
|
set_hydrating(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
batch?.deactivate();
|
|
|
|
|
unset_context();
|
|
|
|
|
})
|
|
|
|
|
@ -108,12 +102,6 @@ export function capture() {
|
|
|
|
|
var previous_component_context = component_context;
|
|
|
|
|
var previous_batch = current_batch;
|
|
|
|
|
|
|
|
|
|
var was_hydrating = hydrating;
|
|
|
|
|
|
|
|
|
|
if (was_hydrating) {
|
|
|
|
|
var previous_hydrate_node = hydrate_node;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (DEV) {
|
|
|
|
|
var previous_dev_stack = dev_stack;
|
|
|
|
|
}
|
|
|
|
|
@ -124,11 +112,6 @@ export function capture() {
|
|
|
|
|
set_component_context(previous_component_context);
|
|
|
|
|
if (activate_batch) previous_batch?.activate();
|
|
|
|
|
|
|
|
|
|
if (was_hydrating) {
|
|
|
|
|
set_hydrating(true);
|
|
|
|
|
set_hydrate_node(previous_hydrate_node);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (DEV) {
|
|
|
|
|
set_from_async_derived(null);
|
|
|
|
|
set_dev_stack(previous_dev_stack);
|
|
|
|
|
@ -265,10 +248,6 @@ export async function async_body(anchor, fn) {
|
|
|
|
|
invoke_error_boundary(error, active);
|
|
|
|
|
}
|
|
|
|
|
} finally {
|
|
|
|
|
if (was_hydrating) {
|
|
|
|
|
set_hydrating(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
boundary.update_pending_count(-1);
|
|
|
|
|
batch.decrement(blocking);
|
|
|
|
|
|
|
|
|
|
@ -294,8 +273,6 @@ export function run(thunks) {
|
|
|
|
|
/** @type {null | { error: any }} */
|
|
|
|
|
var errored = null;
|
|
|
|
|
|
|
|
|
|
let was_hydrating = hydrating;
|
|
|
|
|
|
|
|
|
|
/** @param {any} error */
|
|
|
|
|
const handle_error = (error) => {
|
|
|
|
|
errored = { error }; // wrap in object in case a promise rejects with a falsy value
|
|
|
|
|
@ -326,19 +303,11 @@ export function run(thunks) {
|
|
|
|
|
} finally {
|
|
|
|
|
// TODO do we need it here as well as below?
|
|
|
|
|
unset_context();
|
|
|
|
|
|
|
|
|
|
if (was_hydrating) {
|
|
|
|
|
set_hydrating(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(handle_error)
|
|
|
|
|
.finally(() => {
|
|
|
|
|
unset_context();
|
|
|
|
|
|
|
|
|
|
if (was_hydrating) {
|
|
|
|
|
set_hydrating(false);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
promises.push(promise);
|
|
|
|
|
|