Index: test/mjsunit/array-shift.js |
diff --git a/test/mjsunit/array-shift.js b/test/mjsunit/array-shift.js |
index 3601cbbb89aab226e5c090711aeff4a78a84bb4b..ad742e12ee18ca044da7f11be9f7cae82d6fde9b 100644 |
--- a/test/mjsunit/array-shift.js |
+++ b/test/mjsunit/array-shift.js |
@@ -106,3 +106,17 @@ |
assertEquals(array[7], array_proto[7]); |
assertFalse(array.hasOwnProperty(7)); |
})(); |
+ |
+// Check that non-enumerable elements are treated appropriately |
+(function() { |
+ var array = [1, 2, 3]; |
+ Object.defineProperty(array, '1', {enumerable: false}); |
+ assertEquals(1, array.shift()); |
+ assertEquals([2, 3], array); |
+ |
+ array = [1,,3]; |
+ array.__proto__[1] = 2; |
+ Object.defineProperty(array.__proto__, '1', {enumerable: false}); |
+ assertEquals(1, array.shift()); |
+ assertEquals([2, 3], array); |
+})(); |