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

Unified Diff: test/mjsunit/harmony/array-fill.js

Issue 553623004: ES6: Array.prototype.slice and friends should use ToLength instead of ToUint32 Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove failing tests. Created 5 years, 10 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-length.js ('k') | test/mjsunit/harmony/array-length.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/array-fill.js
diff --git a/test/mjsunit/harmony/array-fill.js b/test/mjsunit/harmony/array-fill.js
index eae18d113bf7e3d4fbbc2ecba48940009fc08f5b..2bbd4af53ffbfcc1eb20f3766d4af212c6d210d4 100644
--- a/test/mjsunit/harmony/array-fill.js
+++ b/test/mjsunit/harmony/array-fill.js
@@ -30,3 +30,23 @@ assertArrayEquals(Object.freeze([1, 2, 3]).fill(0, 0, 0), [1, 2, 3]);
assertThrows('Object.freeze([0]).fill()', TypeError);
assertThrows('Array.prototype.fill.call(null)', TypeError);
assertThrows('Array.prototype.fill.call(undefined)', TypeError);
+
+// Test with large values, and negative start offset and end offset
+var o = { length: Number.MIN_VALUE };
+var result = Array.prototype.fill.call(o, "foo");
+assertEquals(Number.MIN_VALUE, result.length);
+
+var o = { length: Number.MAX_SAFE_INTEGER };
+Array.prototype.fill.call(o, "foo", 0, 9);
+assertEquals(Number.MAX_SAFE_INTEGER, o.length);
+assertEquals("foo", o[0]);
+
+var o = { length: Number.MAX_SAFE_INTEGER };
+Array.prototype.fill.call(o, "foo", 0, Number.MIN_SAFE_INTEGER);
+assertEquals(Number.MAX_SAFE_INTEGER, o.length);
+assertEquals(undefined, o[0]);
+
+var o = { length: Number.MAX_SAFE_INTEGER };
+Array.prototype.fill.call(o, "foo", Number.MIN_SAFE_INTEGER, 0);
+assertEquals(Number.MAX_SAFE_INTEGER, o.length);
+assertEquals(undefined, o[0]);
« no previous file with comments | « test/mjsunit/array-length.js ('k') | test/mjsunit/harmony/array-length.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698