Issue #618 - Remove context and heap-idle check

For checking if a module is in an error state and what the error is, it
shouldn't matter if we are currently GC-ing or not. So we don't need to check
for it, which removes the requirement to pass in the JS context (needed for
AssertHeapIsIdle's runtime check); this unblocks progress where otherwise we'd
have to figure out what the context is at the module level just to satisfy this
check.
This commit is contained in:
Moonchild 2020-07-04 12:59:38 +00:00 committed by Roy Tam
commit c65ca2ca58
2 changed files with 4 additions and 8 deletions

View file

@ -4740,18 +4740,14 @@ JS::GetModuleScript(JSContext* cx, JS::HandleObject moduleArg)
}
JS_PUBLIC_API(bool)
JS::IsModuleErrored(JSContext* cx, JSObject* moduleArg)
JS::IsModuleErrored(JSObject* moduleArg)
{
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
return moduleArg->as<ModuleObject>().status() == MODULE_STATUS_ERRORED;
}
JS_PUBLIC_API(JS::Value)
JS::GetModuleError(JSContext* cx, JSObject* moduleArg)
JS::GetModuleError(JSObject* moduleArg)
{
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
return moduleArg->as<ModuleObject>().error();
}