Bug 1468252 part 6 - Use isSelfHostingZone instead of isSelfHostingGlobal in getNonWrapperObjectForCurrentCompartment. r=evilpie
authorJan de Mooij <jdemooij@mozilla.com>
Thu, 14 Jun 2018 09:07:31 -0700
changeset 422556 d2931773b28b
parent 422555 e9c6358496ff
child 422557 5a19b871c590
push id34138
push userdluca@mozilla.com
push dateFri, 15 Jun 2018 02:39:59 +0000
treeherdermozilla-central@e51f8dbf0397 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersevilpie
bugs1468252
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1468252 part 6 - Use isSelfHostingZone instead of isSelfHostingGlobal in getNonWrapperObjectForCurrentCompartment. r=evilpie
js/src/vm/Compartment.cpp
--- a/js/src/vm/Compartment.cpp
+++ b/js/src/vm/Compartment.cpp
@@ -193,25 +193,25 @@ Compartment::wrap(JSContext* cx, Mutable
     bi.set(copy);
     return true;
 }
 #endif
 
 bool
 Compartment::getNonWrapperObjectForCurrentCompartment(JSContext* cx, MutableHandleObject obj)
 {
-    // Ensure that we have entered a compartment.
+    // Ensure that we have entered a realm.
     MOZ_ASSERT(cx->global());
 
     // If we have a cross-compartment wrapper, make sure that the cx isn't
-    // associated with the self-hosting global. We don't want to create
+    // associated with the self-hosting zone. We don't want to create
     // wrappers for objects in other runtimes, which may be the case for the
-    // self-hosting global.
-    MOZ_ASSERT(!cx->runtime()->isSelfHostingGlobal(cx->global()));
-    MOZ_ASSERT(!cx->runtime()->isSelfHostingGlobal(&obj->global()));
+    // self-hosting zone.
+    MOZ_ASSERT(!cx->runtime()->isSelfHostingZone(cx->zone()));
+    MOZ_ASSERT(!cx->runtime()->isSelfHostingZone(obj->zone()));
 
     // The object is already in the right compartment. Normally same-
     // compartment returns the object itself, however, windows are always
     // wrapped by a proxy, so we have to check for that case here manually.
     if (obj->compartment() == this) {
         obj.set(ToWindowProxyIfWindow(obj));
         return true;
     }