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

Unified Diff: test/mjsunit/third_party/object-keys/object-keys.js

Issue 1397063002: [runtime] Fancify KeyAccumulator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: nits Created 5 years, 2 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/runtime-object.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/third_party/object-keys/object-keys.js
diff --git a/test/mjsunit/third_party/object-keys/object-keys.js b/test/mjsunit/third_party/object-keys/object-keys.js
index c8003745c4b1c5ccfb4b2b04e0f9eca72594f3f7..39336090ea5e646ef52fa19cdce3761c299ccd0e 100644
--- a/test/mjsunit/third_party/object-keys/object-keys.js
+++ b/test/mjsunit/third_party/object-keys/object-keys.js
@@ -42,6 +42,7 @@ assertEquals(Object.keys({a:null, b:null}), ['a', 'b']);
assertEquals(Object.keys({b:null, a:null}), ['b', 'a']);
assertEquals(Object.keys([]), []);
assertEquals(Object.keys([null]), ['0']);
+assertEquals(Object.keys([undefined]), ['0']);
assertEquals(Object.keys([null,null]), ['0', '1']);
assertEquals(Object.keys([null,null,,,,null]), ['0', '1', '5']);
assertEquals(Object.keys({__proto__:{a:null}}), []);
@@ -66,3 +67,34 @@ keysBefore[0] = 'x';
var keysAfter = Object.keys(literal);
assertEquals(['a', 'b', 'c'], keysAfter);
assertEquals(['x', 'b', 'c'], keysBefore);
+
+
+var o = [1, 2, 3];
+assertEquals(['0', '1', '2'], Object.keys(o));
+Object.defineProperty(o, '0', {
+ enumerable: false,
+});
+assertEquals(['1', '2'], Object.keys(o));
+
+
+(function(){
+ assertEquals(['0', '1', '2'], Object.keys(arguments));
+ Object.defineProperty(arguments, '0', {
+ enumerable: false,
+ });
+ assertEquals(['1', '2'], Object.keys(arguments));
+})(0,1,2);
+
+
+(function(a, b){
+ assertEquals(['0', '1', '2'], Object.keys(arguments));
+ Object.defineProperty(arguments, '0', {
+ enumerable: false,
+ });
+ assertEquals(['1', '2'], Object.keys(arguments));
+})(0,1,2);
+
+var b = [];
+assertEquals(0, Object.keys(b).length);
+b[0] = undefined;
+assertEquals(1, Object.keys(b).length);
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698