Bug 613457 - clean up string interfaces (r=njn)

This commit is contained in:
Luke Wagner
2011-03-14 13:59:53 -07:00
parent e61b795ad1
commit bd750d98e0
60 changed files with 1546 additions and 1428 deletions

View File

@@ -108,6 +108,7 @@
#include "jscntxtinlines.h"
#include "jsinterpinlines.h"
#include "jsobjinlines.h"
#include "jsstrinlines.h"
using namespace js;
using namespace js::gc;
@@ -1250,7 +1251,7 @@ array_toString_sub(JSContext *cx, JSObject *obj, JSBool locale,
genBefore = cx->busyArrays.generation();
} else {
/* Cycle, so return empty string. */
rval->setString(ATOM_TO_STRING(cx->runtime->atomState.emptyAtom));
rval->setString(cx->runtime->atomState.emptyAtom);
return true;
}
@@ -3265,7 +3266,7 @@ js_CloneDensePrimitiveArray(JSContext *cx, JSObject *obj, JSObject **clone)
if (val.isString()) {
// Strings must be made immutable before being copied to a clone.
if (!js_MakeStringImmutable(cx, val.toString()))
if (!val.toString()->ensureFixed(cx))
return JS_FALSE;
} else if (val.isObject()) {
/*