Bug 686582 - Begin to specialize ObjectOps::setElementAttributes to not just delegate to ObjectOps::setAttributes. r=dvander

This commit is contained in:
Jeff Walden
2011-08-10 14:54:52 -07:00
parent b345338050
commit 2d2130f6a4
5 changed files with 30 additions and 26 deletions

View File

@@ -1011,18 +1011,15 @@ array_getElementAttributes(JSContext *cx, JSObject *obj, uint32 index, uintN *at
static JSBool
array_setAttributes(JSContext *cx, JSObject *obj, jsid id, uintN *attrsp)
{
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
JSMSG_CANT_SET_ARRAY_ATTRS);
return JS_FALSE;
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_CANT_SET_ARRAY_ATTRS);
return false;
}
static JSBool
array_setElementAttributes(JSContext *cx, JSObject *obj, uint32 index, uintN *attrsp)
{
jsid id;
if (!IndexToId(cx, index, &id))
return false;
return array_setAttributes(cx, obj, id, attrsp);
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_CANT_SET_ARRAY_ATTRS);
return false;
}
namespace js {