MCPcopy Create free account
hub / github.com/GNOME/gjs / fail_import

Function fail_import

gjs/module.cpp:617–622  ·  view source on GitHub ↗

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().

Source from the content-addressed store, hash-verified

615// the internal promise; or in an uncatchable exception such as OOM, in which
616// case we must not call JS::FinishDynamicModuleImport().
617GJS_JSAPI_RETURN_CONVENTION
618static 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
624GJS_JSAPI_RETURN_CONVENTION
625static bool import_rejected(JSContext* cx, unsigned argc, JS::Value* vp) {

Callers 1

import_resolvedFunction · 0.85

Calls 1

finish_importFunction · 0.85

Tested by

no test coverage detected