fix await stuck indefinitely without catch (#5402)

pull/5404/head
Tan Li Hau 4 years ago committed by GitHub
parent 1ce6ac5d48
commit 87ed0b2f42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -6,6 +6,7 @@
* Fix transitions that are parameterised with stores ([#5244](https://github.com/sveltejs/svelte/issues/5244)) * Fix transitions that are parameterised with stores ([#5244](https://github.com/sveltejs/svelte/issues/5244))
* Fix scoping of styles involving child selector and `*` ([#5370](https://github.com/sveltejs/svelte/issues/5370)) * Fix scoping of styles involving child selector and `*` ([#5370](https://github.com/sveltejs/svelte/issues/5370))
* Fix destructuring which reassigns stores ([#5388](https://github.com/sveltejs/svelte/issues/5388)) * Fix destructuring which reassigns stores ([#5388](https://github.com/sveltejs/svelte/issues/5388))
* Fix `{#await}`s with no `{:catch}` getting stuck unresolved if the promise rejects ([#5401](https://github.com/sveltejs/svelte/issues/5401))
## 3.25.0 ## 3.25.0

@ -59,12 +59,12 @@ export function handle_promise(promise, info) {
update(info.then, 1, info.value, value); update(info.then, 1, info.value, value);
set_current_component(null); set_current_component(null);
}, error => { }, error => {
if (!info.hasCatch) {
throw error;
}
set_current_component(current_component); set_current_component(current_component);
update(info.catch, 2, info.error, error); update(info.catch, 2, info.error, error);
set_current_component(null); set_current_component(null);
if (!info.hasCatch) {
throw error;
}
}); });
// if we previously had a then/catch block, destroy it // if we previously had a then/catch block, destroy it

@ -39,6 +39,7 @@ export default {
}) })
.catch((err) => { .catch((err) => {
assert.equal(err.message, 'this error should be thrown'); assert.equal(err.message, 'this error should be thrown');
assert.htmlEqual(target.innerHTML, '');
}); });
} }
}; };
Loading…
Cancel
Save