Skip to content

Commit

Permalink
fix: add missing return (#506)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
xxshady authored Oct 1, 2024
1 parent 6b84470 commit f0eabad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/js-component-bindgen/src/transpile_bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit f0eabad

Please sign in to comment.