Bug 1024170 - Replace zone calls in JSCompartment::wrap with zoneFromAnyThread. r=bhackett

This commit is contained in:
Shihua Zheng 2014-06-11 16:39:04 -07:00
parent 9636f6ed66
commit cea758df44

View File

@ -271,12 +271,13 @@ JSCompartment::wrap(JSContext *cx, JSString **strp)
/* If the string is already in this compartment, we are done. */
JSString *str = *strp;
if (str->zone() == zone())
if (str->zoneFromAnyThread() == zone())
return true;
/* If the string is an atom, we don't have to copy. */
if (str->isAtom()) {
JS_ASSERT(cx->runtime()->isAtomsZone(str->zone()));
JS_ASSERT(str->isPermanentAtom() ||
cx->runtime()->isAtomsZone(str->zone()));
return true;
}