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

Side by Side 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 unified diff | Download patch
« src/builtins.cc ('K') | « src/runtime/runtime-array.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --harmony-concat-spreadable 5 // Flags: --harmony-concat-spreadable
6 6
7 (function testArrayConcatArity() { 7 (function testArrayConcatArity() {
8 "use strict"; 8 "use strict";
9 assertEquals(1, Array.prototype.concat.length); 9 assertEquals(1, Array.prototype.concat.length);
10 })(); 10 })();
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 arr3.length = 10000; 699 arr3.length = 10000;
700 for (var i = 0; i < 100; i++) { 700 for (var i = 0; i < 100; i++) {
701 Object.defineProperty(arr3, i * i, {get: mkGetter(i)}); 701 Object.defineProperty(arr3, i * i, {get: mkGetter(i)});
702 expectedTrace[i] = i; 702 expectedTrace[i] = i;
703 expectedTrace[100 + i] = i; 703 expectedTrace[100 + i] = i;
704 } 704 }
705 var r4 = [0].concat(arr3, arr3); 705 var r4 = [0].concat(arr3, arr3);
706 assertEquals(1 + arr3.length * 2, r4.length); 706 assertEquals(1 + arr3.length * 2, r4.length);
707 assertEquals(expectedTrace, trace); 707 assertEquals(expectedTrace, trace);
708 })(); 708 })();
709
710
711 (function testConcatArrayNonSpreadable() {
712 "use strict";
713 var b = [];
714 b[Symbol.isConcatSpreadable] = false;
715 assertEquals(2, b.concat(b).length);
716 assertEquals(1, [].concat(b).length);
717 assertEquals(1, [].concat(b, new Array).length);
718 assertEquals(2, [].concat(b, new Object).length);
719 })();
OLDNEW
« 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