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

Unified Diff: test/mjsunit/harmony/harmony-string-pad-end.js

Issue 1926773003: [esnext] implement StringPad spec changes from March TC39 meeting (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/js/harmony-string-padding.js ('k') | test/mjsunit/harmony/harmony-string-pad-start.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/harmony-string-pad-end.js
diff --git a/test/mjsunit/harmony/harmony-string-pad-end.js b/test/mjsunit/harmony/harmony-string-pad-end.js
index 3292e94eeec92945983d16259ece19c77e4a22b7..03e5aeacdb491453f40ca2b1534f3dcc457f9e95 100644
--- a/test/mjsunit/harmony/harmony-string-pad-end.js
+++ b/test/mjsunit/harmony/harmony-string-pad-end.js
@@ -67,8 +67,19 @@
(function TestFillerToString() {
assertEquals(". ", ".".padEnd(10));
assertEquals(". ", ".".padEnd(10, undefined));
- assertEquals(". ", ".".padEnd(10, { toString() { return ""; } }));
assertEquals(".nullnulln", ".".padEnd(10, null));
+ assertEquals(".XXXXXXXXX", ".".padEnd(10, { toString() { return "X"; } }));
+ assertEquals(
+ ".111111111",
+ ".".padEnd(10, { toString: undefined, valueOf() { return 1; } }));
+})();
+
+
+(function TestFillerEmptyString() {
+ assertEquals(".", ".".padEnd(10, ""));
+ assertEquals(".", ".".padEnd(10, { toString() { return ""; } }));
+ assertEquals(
+ ".", ".".padEnd(10, { toString: undefined, valueOf() { return ""; } }));
})();
« no previous file with comments | « src/js/harmony-string-padding.js ('k') | test/mjsunit/harmony/harmony-string-pad-start.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698