quickjs-rs icon indicating copy to clipboard operation
quickjs-rs copied to clipboard

Added support for returning undefined in async functions

Open awestlake87 opened this issue 2 years ago • 0 comments

Currently quickjs-rs is not able to handle async functions that return undefined. Functions like async () => { } or async () => undefined will throw the following error:

failures:

---- tests::test_async_fn_returning_undefined stdout ----
thread 'tests::test_async_fn_returning_undefined' panicked at 'called `Result::unwrap()` on an `Err` value: Internal("Property '__promiseValue' not found")', src/tests.rs:629:43
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This PR allows __promiseValue to be undefined when __promiseResult === true

awestlake87 avatar Jun 23 '22 03:06 awestlake87