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

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

Issue 1409123003: [runtime] Avoid @@isConcatSpreadable lookup for fast path Array.prototype.concat (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: merging with master Created 4 years, 7 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/cctest/heap/test-heap.cc ('k') | test/mjsunit/harmony/array-concat-array-proto.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/array-concat.js
diff --git a/test/mjsunit/es6/array-concat.js b/test/mjsunit/es6/array-concat.js
index fe320d6858665b67f7524f597968bf7b7831314f..00edfd66c1c52466113f7ef649d40fe209ea9d29 100644
--- a/test/mjsunit/es6/array-concat.js
+++ b/test/mjsunit/es6/array-concat.js
@@ -1,7 +1,6 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
(function testArrayConcatArity() {
"use strict";
assertEquals(1, Array.prototype.concat.length);
@@ -20,6 +19,15 @@
assertEquals(false, desc.enumerable);
})();
+(function testNonConcatSpreadableArray() {
+ "use strict"
+ var array = [1, 2, 3];
+ assertEquals(array, [].concat(array));
+ assertEquals(array, array.concat([]));
+ array[Symbol.isConcatSpreadable] = false;
+ assertEquals([[1,2,3]], [].concat(array));
+ assertEquals([[1,2,3]], array.concat([]));
+})();
(function testConcatArrayLike() {
"use strict";
« no previous file with comments | « test/cctest/heap/test-heap.cc ('k') | test/mjsunit/harmony/array-concat-array-proto.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698