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

Unified Diff: test/mjsunit/es6/typedarray-tostring.js

Issue 2141603002: Make toLocaleString on arrays always call toLocaleString on its elements. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Simplify. Created 4 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
« no previous file with comments | « test/mjsunit/array-tostring.js ('k') | test/test262/test262.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/typedarray-tostring.js
diff --git a/test/mjsunit/es6/typedarray-tostring.js b/test/mjsunit/es6/typedarray-tostring.js
index e6adda0405764acee981495a8e72deeb3762d604..9d49cb1cc9a76b23c0e638f69bf71c42fa4e6e43 100644
--- a/test/mjsunit/es6/typedarray-tostring.js
+++ b/test/mjsunit/es6/typedarray-tostring.js
@@ -83,4 +83,17 @@ for (var constructor of typedArrayConstructors) {
assertEquals("1,2", Array.prototype.join.call(a5));
assertEquals("1,2,3", Array.prototype.toString.call(a5));
assertEquals("1,2", Array.prototype.toLocaleString.call(a5));
+
+ (function TestToLocaleStringCalls() {
+ let log = [];
+ let pushArgs = (label) => (...args) => log.push(label, args);
+
+ let NumberToLocaleString = Number.prototype.toLocaleString;
+ Number.prototype.toLocaleString = pushArgs("Number");
+
+ (new constructor([1, 2])).toLocaleString();
+ assertEquals(["Number", [], "Number", []], log);
+
+ Number.prototype.toLocaleString = NumberToLocaleString;
+ })();
}
« no previous file with comments | « test/mjsunit/array-tostring.js ('k') | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698