Bug 645468 - Remove js_TryMethod: its semantics aren't what most of its users want, and its utility is limited. r=luke
This commit is contained in:
@@ -1280,16 +1280,14 @@ array_toString_sub(JSContext *cx, JSObject *obj, JSBool locale,
|
||||
}
|
||||
|
||||
/* Get element's character string. */
|
||||
if (!(hole || rval->isNullOrUndefined())) {
|
||||
if (!hole && !rval->isNullOrUndefined()) {
|
||||
if (locale) {
|
||||
/* Work on obj.toLocalString() instead. */
|
||||
JSObject *robj;
|
||||
|
||||
if (!js_ValueToObjectOrNull(cx, *rval, &robj))
|
||||
JSObject *robj = ToObject(cx, rval);
|
||||
if (!robj)
|
||||
goto out;
|
||||
rval->setObjectOrNull(robj);
|
||||
JSAtom *atom = cx->runtime->atomState.toLocaleStringAtom;
|
||||
if (!js_TryMethod(cx, robj, atom, 0, NULL, rval))
|
||||
jsid id = ATOM_TO_JSID(cx->runtime->atomState.toLocaleStringAtom);
|
||||
if (!robj->callMethod(cx, id, 0, NULL, rval))
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user