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

Unified Diff: test/mjsunit/harmony/harmony-string-pad-start.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 | « test/mjsunit/harmony/harmony-string-pad-end.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/harmony-string-pad-start.js
diff --git a/test/mjsunit/harmony/harmony-string-pad-start.js b/test/mjsunit/harmony/harmony-string-pad-start.js
index 2b2d004251a13a82fbd9a382177f8bf65ed20f4f..33bf8f3c9d5c11a7139c7012a3e69113cb370eed 100644
--- a/test/mjsunit/harmony/harmony-string-pad-start.js
+++ b/test/mjsunit/harmony/harmony-string-pad-start.js
@@ -67,8 +67,19 @@
(function TestFillerToString() {
assertEquals(" .", ".".padStart(10));
assertEquals(" .", ".".padStart(10, undefined));
- assertEquals(" .", ".".padStart(10, { toString() { return ""; } }));
assertEquals("nullnulln.", ".".padStart(10, null));
+ assertEquals("XXXXXXXXX.", ".".padStart(10, { toString() { return "X"; } }));
+ assertEquals(
+ "111111111.",
+ ".".padStart(10, { toString: undefined, valueOf() { return 1; } }));
+})();
+
+
+(function TestFillerEmptyString() {
+ assertEquals(".", ".".padStart(10, ""));
+ assertEquals(".", ".".padStart(10, { toString() { return ""; } }));
+ assertEquals(
+ ".", ".".padStart(10, { toString: undefined, valueOf() { return ""; } }));
})();
« no previous file with comments | « test/mjsunit/harmony/harmony-string-pad-end.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698