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

Unified Diff: test/mjsunit/array-unshift.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 | « test/mjsunit/array-shift.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+})();
« no previous file with comments | « test/mjsunit/array-shift.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698