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

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

Issue 1804963002: [builtins] Fix Array.prototype.concat bug (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: polishing corner cases and making tests work Created 4 years, 9 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/elements.cc ('k') | test/mjsunit/es6/array-concat.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/array-concat.js
diff --git a/test/mjsunit/array-concat.js b/test/mjsunit/array-concat.js
index 97bd85aca2e646cd391558e0648458575d4e3c8b..6e25b5c5cd320c13dbbdeeb9fa0f6d5215a464fb 100644
--- a/test/mjsunit/array-concat.js
+++ b/test/mjsunit/array-concat.js
@@ -29,6 +29,19 @@
* @fileoverview Test concat on small and large arrays
*/
+
+(function testStringWrapperConcat() {
+ var concat = Array.prototype.concat;
+ var str = new String('abcd');
+ assertEquals([1,2,3,new String('abcd')], [1, 2, 3].concat(str));
+ assertEquals([new String("abcd")], concat.call(str));
+
+ var array = [1, 2, 3];
+ array.__proto__ = str;
+ array.length = 4;
+ assertEquals([1,2,3,'d'], concat.call(array));
+})()
+
var poses;
poses = [140, 4000000000];
« no previous file with comments | « src/elements.cc ('k') | test/mjsunit/es6/array-concat.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698