зеркало из https://github.com/mozilla/gecko-dev.git
Bug 563845 - skip jsval-to-jsid conversion when jsval is a jsid (r=igor)
This commit is contained in:
Родитель
4e1453ef5b
Коммит
031310bf07
|
@ -576,9 +576,8 @@ ArgSetter(JSContext *cx, JSObject *obj, jsval idval, jsval *vp)
|
||||||
* args_delete to clear the corresponding reserved slot so the GC can
|
* args_delete to clear the corresponding reserved slot so the GC can
|
||||||
* collect its value.
|
* collect its value.
|
||||||
*/
|
*/
|
||||||
jsid id;
|
JS_ASSERT_IF(JSVAL_IS_STRING(idval), JSVAL_TO_STRING(idval)->isAtomized());
|
||||||
if (!JS_ValueToId(cx, idval, &id))
|
jsid id = (jsid)idval;
|
||||||
return false;
|
|
||||||
|
|
||||||
AutoValueRooter tvr(cx);
|
AutoValueRooter tvr(cx);
|
||||||
return js_DeleteProperty(cx, obj, id, tvr.addr()) &&
|
return js_DeleteProperty(cx, obj, id, tvr.addr()) &&
|
||||||
|
@ -1151,7 +1150,6 @@ call_resolve(JSContext *cx, JSObject *obj, jsval idval, uintN flags,
|
||||||
{
|
{
|
||||||
jsval callee;
|
jsval callee;
|
||||||
JSFunction *fun;
|
JSFunction *fun;
|
||||||
jsid id;
|
|
||||||
JSLocalKind localKind;
|
JSLocalKind localKind;
|
||||||
JSPropertyOp getter, setter;
|
JSPropertyOp getter, setter;
|
||||||
uintN slot, attrs;
|
uintN slot, attrs;
|
||||||
|
@ -1162,14 +1160,14 @@ call_resolve(JSContext *cx, JSObject *obj, jsval idval, uintN flags,
|
||||||
if (!JSVAL_IS_STRING(idval))
|
if (!JSVAL_IS_STRING(idval))
|
||||||
return JS_TRUE;
|
return JS_TRUE;
|
||||||
|
|
||||||
|
JS_ASSERT(JSVAL_TO_STRING(idval)->isAtomized());
|
||||||
|
jsid id = (jsval)idval;
|
||||||
|
|
||||||
callee = obj->getSlot(JSSLOT_CALLEE);
|
callee = obj->getSlot(JSSLOT_CALLEE);
|
||||||
if (JSVAL_IS_VOID(callee))
|
if (JSVAL_IS_VOID(callee))
|
||||||
return JS_TRUE;
|
return JS_TRUE;
|
||||||
fun = GET_FUNCTION_PRIVATE(cx, JSVAL_TO_OBJECT(callee));
|
fun = GET_FUNCTION_PRIVATE(cx, JSVAL_TO_OBJECT(callee));
|
||||||
|
|
||||||
if (!js_ValueToStringId(cx, idval, &id))
|
|
||||||
return JS_FALSE;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check whether the id refers to a formal parameter, local variable or
|
* Check whether the id refers to a formal parameter, local variable or
|
||||||
* the arguments special name.
|
* the arguments special name.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче