Bug 509047 - Defining a property that forces a dense array to become sparse shouldn't call a setter. r=brendan.
This commit is contained in:
@@ -970,7 +970,7 @@ array_defineProperty(JSContext *cx, JSObject *obj, jsid id, jsval value,
|
||||
return JS_TRUE;
|
||||
|
||||
isIndex = js_IdIsIndex(ID_TO_VALUE(id), &i);
|
||||
if (!isIndex || attrs != JSPROP_ENUMERATE) {
|
||||
if (!isIndex || attrs != JSPROP_ENUMERATE || !OBJ_IS_DENSE_ARRAY(cx, obj) || INDEX_TOO_SPARSE(obj, i)) {
|
||||
if (!ENSURE_SLOW_ARRAY(cx, obj))
|
||||
return JS_FALSE;
|
||||
return js_DefineProperty(cx, obj, id, value, getter, setter, attrs, propp);
|
||||
|
||||
Reference in New Issue
Block a user