Bug 1529203 - Add release build assertions around using modules with the wrong global r=jandem a=abillings
authorJon Coppeard <jcoppeard@mozilla.com>
Sat, 02 Mar 2019 09:04:06 +0000
changeset 516234 4c7d56a0a897172ef44a9a63047ceba033ac49e1
parent 516233 0f09554ca8cbab37de0187b6d67a25739a18ede4
child 516235 3a3ef7d12fd9cb36ce1d6aa3515b2b5749608072
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem, abillings
bugs1529203
milestone66.0
Bug 1529203 - Add release build assertions around using modules with the wrong global r=jandem a=abillings
js/src/jsapi.cpp
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -3769,25 +3769,25 @@ JS_PUBLIC_API void JS::SetScriptPrivateR
   rt->scriptPrivateAddRefHook = addRefHook;
   rt->scriptPrivateReleaseHook = releaseHook;
 }
 
 JS_PUBLIC_API bool JS::ModuleInstantiate(JSContext* cx,
                                          JS::HandleObject moduleArg) {
   AssertHeapIsIdle();
   CHECK_THREAD(cx);
-  cx->check(moduleArg);
+  cx->releaseCheck(moduleArg);
   return ModuleObject::Instantiate(cx, moduleArg.as<ModuleObject>());
 }
 
 JS_PUBLIC_API bool JS::ModuleEvaluate(JSContext* cx,
                                       JS::HandleObject moduleArg) {
   AssertHeapIsIdle();
   CHECK_THREAD(cx);
-  cx->check(moduleArg);
+  cx->releaseCheck(moduleArg);
   return ModuleObject::Evaluate(cx, moduleArg.as<ModuleObject>());
 }
 
 JS_PUBLIC_API JSObject* JS::GetRequestedModules(JSContext* cx,
                                                 JS::HandleObject moduleArg) {
   AssertHeapIsIdle();
   CHECK_THREAD(cx);
   cx->check(moduleArg);
@@ -5173,17 +5173,17 @@ JS_PUBLIC_API bool JS_GetPendingExceptio
     return false;
   }
   return cx->getPendingException(vp);
 }
 
 JS_PUBLIC_API void JS_SetPendingException(JSContext* cx, HandleValue value) {
   AssertHeapIsIdle();
   CHECK_THREAD(cx);
-  cx->check(value);
+  cx->releaseCheck(value);
   cx->setPendingException(value);
 }
 
 JS_PUBLIC_API void JS_ClearPendingException(JSContext* cx) {
   AssertHeapIsIdle();
   cx->clearPendingException();
 }