bellard / quickjs

Public repository of the QuickJS Javascript Engine.
https://bellard.org/quickjs
Other
8.52k stars 892 forks source link

Uncaughtable error seems to be caughtable when it occurs inside a Promise, is that an expected behavior? #341

Open laishere opened 3 months ago

laishere commented 3 months ago

The uncaughtable error can be thrown by an interrupt handler.

Noticed that the fail logic of js_async_function_resume function doesn't check if an exception is caughtable before sending it to the reject function of the Promise.

I wonder if it is an expected behavior.

https://github.com/bellard/quickjs/blob/6e2e68fd0896957f92eb6c242a2e048c1ef3cae0/quickjs.c#L19236-L19239