Bug 625484 - rename defaultCompartment r=gal

This commit is contained in:
Gregor Wagner
2011-01-13 14:42:36 -08:00
parent 6e9371b65e
commit d143d44a0e
8 changed files with 75 additions and 75 deletions

View File

@@ -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)