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

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

Issue 669101: Fix invalid fast return in splice when returned array is empty. (Closed)
Patch Set: 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
« src/builtins.cc ('K') | « src/builtins.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/array-splice.js
diff --git a/test/mjsunit/array-splice.js b/test/mjsunit/array-splice.js
index bd471eceb6e9f25c3d6a5b4d8701cc68651cf7fb..8e2789b152c22e3e414a98df0f43a157b0efef91 100644
--- a/test/mjsunit/array-splice.js
+++ b/test/mjsunit/array-splice.js
@@ -53,6 +53,16 @@
})();
+// Check that even if result array is empty, receiver gets sliced.
+(function() {
+ for (var i = 0; i < 7; i++) {
+ var a = [1, 2, 3];
+ assertEquals([], a.splice(1, 0, 'a', 'b', 'c'));
+ assertEquals([1, 'a', 'b', 'c', 2, 3], a);
+ }
+})();
+
+
// Check various forms of arguments omission.
(function() {
var array;
« src/builtins.cc ('K') | « src/builtins.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698