From f0eabadcb90c51a9c532ade5dd8d19cb669f559e Mon Sep 17 00:00:00 2001 From: xshady <54737754+xxshady@users.noreply.github.com> Date: Tue, 1 Oct 2024 20:15:10 +0300 Subject: [PATCH] fix: add missing return (#506) abscence of return caused a hidden exception, which was handled by `catch` block and then passed to the `reject` callback while promise was already resolved --- crates/js-component-bindgen/src/transpile_bindgen.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/js-component-bindgen/src/transpile_bindgen.rs b/crates/js-component-bindgen/src/transpile_bindgen.rs index 2e01fca9e..4ce493e38 100644 --- a/crates/js-component-bindgen/src/transpile_bindgen.rs +++ b/crates/js-component-bindgen/src/transpile_bindgen.rs @@ -316,7 +316,7 @@ impl<'a> JsBindgen<'a> { ({{ value, done }} = gen.next(value)); }} while (!(value instanceof Promise) && !done); if (done) {{ - if (resolve) resolve(value); + if (resolve) return resolve(value); else return value; }} if (!promise) promise = new Promise((_resolve, _reject) => (resolve = _resolve, reject = _reject));