Bug 625484 - rename defaultCompartment r=gal
This commit is contained in:
@@ -480,7 +480,7 @@ js_AtomizeString(JSContext *cx, JSString *strArg, uintN flags)
|
||||
JSAtomState *state = &cx->runtime->atomState;
|
||||
AtomSet &atoms = state->atoms;
|
||||
|
||||
AutoLockDefaultCompartment lock(cx);
|
||||
AutoLockAtomsCompartment lock(cx);
|
||||
AtomSet::AddPtr p = atoms.lookupForAdd(str);
|
||||
|
||||
/* Hashing the string should have flattened it if it was a rope. */
|
||||
@@ -495,7 +495,7 @@ js_AtomizeString(JSContext *cx, JSString *strArg, uintN flags)
|
||||
* compartment.
|
||||
*/
|
||||
bool needNewString = !!(flags & ATOM_TMPSTR) ||
|
||||
str->asCell()->compartment() != cx->runtime->defaultCompartment;
|
||||
str->asCell()->compartment() != cx->runtime->atomsCompartment;
|
||||
|
||||
/*
|
||||
* Unless str is already comes from the default compartment and flat,
|
||||
@@ -509,7 +509,7 @@ js_AtomizeString(JSContext *cx, JSString *strArg, uintN flags)
|
||||
atoms.add(p, StringToInitialAtomEntry(key));
|
||||
} else {
|
||||
if (needNewString) {
|
||||
SwitchToCompartment sc(cx, cx->runtime->defaultCompartment);
|
||||
SwitchToCompartment sc(cx, cx->runtime->atomsCompartment);
|
||||
if (flags & ATOM_NOCOPY) {
|
||||
key = js_NewString(cx, const_cast<jschar *>(str->flatChars()), length);
|
||||
if (!key)
|
||||
|
||||
Reference in New Issue
Block a user