Fix tracing of JSOP_IN (465241, r=danderson).
This commit is contained in:
@@ -187,6 +187,20 @@ js_StringToInt32(JSContext* cx, JSString* str)
|
||||
return js_DoubleToECMAInt32(d);
|
||||
}
|
||||
|
||||
static inline JSBool
|
||||
js_Int32ToId(JSContext* cx, int32 index, jsid* id)
|
||||
{
|
||||
if (unsigned(index) <= JSVAL_INT_MAX) {
|
||||
*id = INT_TO_JSID(index);
|
||||
return JS_TRUE;
|
||||
} else {
|
||||
JSString* str = js_NumberToString(cx, index);
|
||||
if (!str)
|
||||
return JS_FALSE;
|
||||
return js_ValueToStringId(cx, STRING_TO_JSVAL(str), id);
|
||||
}
|
||||
}
|
||||
|
||||
jsval FASTCALL
|
||||
js_Any_getprop(JSContext* cx, JSObject* obj, JSString* idstr)
|
||||
{
|
||||
@@ -405,6 +419,21 @@ js_HasNamedProperty(JSContext* cx, JSObject* obj, JSString* idstr)
|
||||
return prop != NULL;
|
||||
}
|
||||
|
||||
JSBool FASTCALL
|
||||
js_HasNamedPropertyInt32(JSContext* cx, JSObject* obj, int32 index)
|
||||
{
|
||||
jsid id;
|
||||
if (!js_Int32ToId(cx, index, &id))
|
||||
return JSVAL_TO_BOOLEAN(JSVAL_VOID);
|
||||
JSObject* obj2;
|
||||
JSProperty* prop;
|
||||
if (!OBJ_LOOKUP_PROPERTY(cx, obj, id, &obj2, &prop))
|
||||
return JSVAL_TO_BOOLEAN(JSVAL_VOID);
|
||||
if (prop)
|
||||
OBJ_DROP_PROPERTY(cx, obj2, prop);
|
||||
return prop != NULL;
|
||||
}
|
||||
|
||||
jsval FASTCALL
|
||||
js_CallGetter(JSContext* cx, JSObject* obj, JSScopeProperty* sprop)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user