Issue #618 - Clear the module map when changing a Document's global and add

release build assertions for mismatching compartments.
This commit is contained in:
Moonchild 2020-09-08 11:00:27 +00:00 committed by roytam1
commit ef11a4d7e8
4 changed files with 17 additions and 3 deletions

View file

@ -4708,7 +4708,7 @@ JS::ModuleInstantiate(JSContext* cx, JS::HandleObject moduleArg)
{
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
assertSameCompartment(cx, moduleArg);
releaseAssertSameCompartment(cx, moduleArg);
return ModuleObject::Instantiate(cx, moduleArg.as<ModuleObject>());
}
@ -4717,7 +4717,7 @@ JS::ModuleEvaluate(JSContext* cx, JS::HandleObject moduleArg)
{
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
assertSameCompartment(cx, moduleArg);
releaseAssertSameCompartment(cx, moduleArg);
return ModuleObject::Evaluate(cx, moduleArg.as<ModuleObject>());
}
@ -6204,7 +6204,7 @@ JS_SetPendingException(JSContext* cx, HandleValue value)
{
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
assertSameCompartment(cx, value);
releaseAssertSameCompartment(cx, value);
cx->setPendingException(value);
}