Index: test/mjsunit/array-unshift.js |
diff --git a/test/mjsunit/array-unshift.js b/test/mjsunit/array-unshift.js |
index c4cc95cbb46f745203d62e472a07b688385b3d74..0ef44b71f29d260008c5c1f80b494f0ddb495a52 100644 |
--- a/test/mjsunit/array-unshift.js |
+++ b/test/mjsunit/array-unshift.js |
@@ -213,3 +213,18 @@ |
assertEquals([1, 2, 3, 4, 5, 6, 7, 8, 9], a); |
} |
})(); |
+ |
+// Check that non-enumerable elements are treated appropriately |
+(function() { |
+ var array = [2, 3]; |
+ Object.defineProperty(array, '1', {enumerable: false}); |
+ array.unshift(1) |
+ assertEquals([1, 2, 3], array); |
+ |
+ array = [2]; |
+ array.length = 2; |
+ array.__proto__[1] = 3; |
+ Object.defineProperty(array.__proto__, '1', {enumerable: false}); |
+ array.unshift(1); |
+ assertEquals([1, 2, 3], array); |
+})(); |