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

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

Issue 669075: Fix a special case (zero length result array). (Closed)
Patch Set: Addressing Vitaly's concerns Created 10 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 | « src/builtins.cc ('k') | test/mjsunit/array-splice.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/array-slice.js
diff --git a/test/mjsunit/array-slice.js b/test/mjsunit/array-slice.js
index c993a077f6696c0a3a41c60c9eab6a424688b229..30e9f3e9eee31d2c1d99ce884c79c1d9340d837b 100644
--- a/test/mjsunit/array-slice.js
+++ b/test/mjsunit/array-slice.js
@@ -36,6 +36,17 @@
})();
+// Check various variants of empty array's slicing.
+(function() {
+ for (var i = 0; i < 7; i++) {
+ assertEquals([], [].slice(0, 0));
+ assertEquals([], [].slice(1, 0));
+ assertEquals([], [].slice(0, 1));
+ assertEquals([], [].slice(-1, 0));
+ }
+})();
+
+
// Check various forms of arguments omission.
(function() {
var array = new Array(7);
« no previous file with comments | « src/builtins.cc ('k') | test/mjsunit/array-splice.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698