From 40aad1a2209607b973170f4fb64548e5d8103402 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sat, 4 Jul 2020 12:59:38 +0000 Subject: 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. --- js/src/jsapi.cpp | 8 ++------ js/src/jsapi.h | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'js') diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index cb0851f80..cf5880e03 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -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().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().error(); } diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 6d306edc5..9c3bf8151 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -4396,10 +4396,10 @@ extern JS_PUBLIC_API(JSScript*) GetModuleScript(JSContext* cx, JS::HandleObject moduleRecord); extern JS_PUBLIC_API(bool) -IsModuleErrored(JSContext* cx, JSObject* moduleRecord); +IsModuleErrored(JSObject* moduleRecord); extern JS_PUBLIC_API(JS::Value) -GetModuleError(JSContext* cx, JSObject* moduleRecord); +GetModuleError(JSObject* moduleRecord); } /* namespace JS */ -- cgit v1.2.3