Bug 1148750, part 11 - Remove some code for TypedArray cases rendered unreachable by part 1 of this bug. r=efaust.
authorJason Orendorff <jorendorff@mozilla.com>
Thu, 09 Apr 2015 15:33:38 -0500
changeset 240430 9ff0866822397d3407076ed3d618d3814c48363f
parent 240429 6d51d528b8c8e9d60530b4cf0bdb103cd89f7ac6
child 240431 cefbe81af44a3cce40507ed2a32a4e153283207c
push id28636
push userkwierso@gmail.com
push dateThu, 23 Apr 2015 00:16:12 +0000
treeherdermozilla-central@a5af73b32ac8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersefaust
bugs1148750
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1148750, part 11 - Remove some code for TypedArray cases rendered unreachable by part 1 of this bug. r=efaust.
js/src/vm/NativeObject.cpp
--- a/js/src/vm/NativeObject.cpp
+++ b/js/src/vm/NativeObject.cpp
@@ -1428,20 +1428,17 @@ js::NativeDefineProperty(ExclusiveContex
             desc.setSetterObject(shape->setterObject());
         }
     } else if (desc.isDataDescriptor() != IsDataDescriptor(shapeAttrs)) {
         // Step 7.
         if (!IsConfigurable(shapeAttrs) && !skipRedefineChecks)
             return result.fail(JSMSG_CANT_REDEFINE_PROP);
 
         if (IsImplicitDenseOrTypedArrayElement(shape)) {
-            if (IsAnyTypedArray(obj)) {
-                // Ignore getter/setter properties added to typed arrays.
-                return result.succeed();
-            }
+            MOZ_ASSERT(!IsAnyTypedArray(obj));
             if (!NativeObject::sparsifyDenseElement(cx, obj, JSID_TO_INT(id)))
                 return false;
             shape = obj->lookup(cx, id);
         }
 
         // Fill in desc fields with default values (steps 7.b.i and 7.c.i).
         CompletePropertyDescriptor(&desc);
     } else if (desc.isDataDescriptor()) {
@@ -1456,22 +1453,17 @@ js::NativeDefineProperty(ExclusiveContex
                 desc.setAttributes(ApplyOrDefaultAttributes(desc.attributes(), shape));
             }
         } else {
             // We have been asked merely to update JSPROP_READONLY (and possibly
             // JSPROP_CONFIGURABLE and/or JSPROP_ENUMERABLE, handled above).
 
             // Don't forget about arrays.
             if (IsImplicitDenseOrTypedArrayElement(shape)) {
-                if (IsAnyTypedArray(obj)) {
-                    // Silently ignore attempts to change individual index attributes.
-                    // FIXME: Uses the same broken behavior as for accessors. This should
-                    //        fail.
-                    return result.succeed();
-                }
+                MOZ_ASSERT(!IsAnyTypedArray(obj));
                 if (!NativeObject::sparsifyDenseElement(cx, obj, JSID_TO_INT(id)))
                     return false;
                 shape = obj->lookup(cx, id);
             }
 
             desc.setAttributes(ApplyOrDefaultAttributes(desc.attributes(), shape));
 
             // We are at most changing some attributes, and cannot convert