Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1208)

Unified Diff: test/mjsunit/array-shift.js

Issue 12653010: Fix %GetArrayKeys to not skip non-enumerable indices (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Handle review comments Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/array-unshift.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+})();
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/array-unshift.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698