Bug 613457 - clean up string interfaces (r=njn)
This commit is contained in:
@@ -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()) {
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user