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

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

Issue 1247243003: The ArrayConcat builtin didn't respect @@isConcatSp (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix builtin rather than removing it Created 5 years, 5 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/runtime/runtime-array.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/array-concat.js
diff --git a/test/mjsunit/harmony/array-concat.js b/test/mjsunit/harmony/array-concat.js
index 71b6790bc7b13e238930ed824d165d76ec903c2c..87bd246cbad7381d42f2a8c2ca294aa9023d0c61 100644
--- a/test/mjsunit/harmony/array-concat.js
+++ b/test/mjsunit/harmony/array-concat.js
@@ -706,3 +706,14 @@ function testConcatTypedArray(type, elems, modulo) {
assertEquals(1 + arr3.length * 2, r4.length);
assertEquals(expectedTrace, trace);
})();
+
+
+(function testConcatArrayNonSpreadable() {
+ "use strict";
+ var b = [];
+ b[Symbol.isConcatSpreadable] = false;
+ assertEquals(2, b.concat(b).length);
+ assertEquals(1, [].concat(b).length);
+ assertEquals(1, [].concat(b, new Array).length);
+ assertEquals(2, [].concat(b, new Object).length);
+})();
« src/builtins.cc ('K') | « src/runtime/runtime-array.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698