dokar3 / quickjs-kt

A QuickJS binding for idiomatic Kotlin, with Async/DSL/ES Modules support.
Apache License 2.0
49 stars 4 forks source link

Issue with catch in promise. #128

Open asoee opened 1 week ago

asoee commented 1 week ago

This js code throws an exception, which i don't think it should:

                async function fetch() {
                    throw Error("bad thing happened");
                };
                await fetch().catch((e) => {});
                'Caught';

The exception is: com.dokar.quickjs.QuickJsException: Error: bad thing happened It is very similar to the other async tests, except that the async function is defined in javascript.

asoee commented 5 days ago

Added test case here: https://github.com/asoee/quickjs-kt/commit/c7270657289f3e84f26246b79f973d50061c9115 which does indeed fail.