Failing a JSAPI function may result either in an exception pending on the context, in which case we must call JS::FinishDynamicModuleImport() to reject the internal promise; or in an uncatchable exception such as OOM, in which case we must not call JS::FinishDynamicModuleImport().
| 615 | // the internal promise; or in an uncatchable exception such as OOM, in which |
| 616 | // case we must not call JS::FinishDynamicModuleImport(). |
| 617 | GJS_JSAPI_RETURN_CONVENTION |
| 618 | static bool fail_import(JSContext* cx, const JS::CallArgs& args) { |
| 619 | if (JS_IsExceptionPending(cx)) |
| 620 | return finish_import(cx, nullptr, args); |
| 621 | return false; |
| 622 | } |
| 623 | |
| 624 | GJS_JSAPI_RETURN_CONVENTION |
| 625 | static bool import_rejected(JSContext* cx, unsigned argc, JS::Value* vp) { |
no test coverage detected