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

Unified Diff: test/mjsunit/es6/string-html.js

Issue 1194173004: Fix string HTML methods to call ToString (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/string.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/string-html.js
diff --git a/test/mjsunit/es6/string-html.js b/test/mjsunit/es6/string-html.js
index 4f3feb56dd1f5e7e10b1f3f9a5e153b450b84f15..1c63221c9f7ec6b0c8949628f8ebd4bffadffe9d 100644
--- a/test/mjsunit/es6/string-html.js
+++ b/test/mjsunit/es6/string-html.js
@@ -157,3 +157,38 @@ assertThrows(function() {
String.prototype.sup.call(null);
}, TypeError);
assertEquals(String.prototype.sup.length, 0);
+
+
+(function TestToString() {
+ var calls = 0;
+ var obj = {
+ toString() {
+ calls++;
+ return 'abc';
+ },
+ valueOf() {
+ assertUnreachable();
+ }
+ };
+
+ var methodNames = [
+ 'anchor',
+ 'big',
+ 'blink',
+ 'bold',
+ 'fixed',
+ 'fontcolor',
+ 'fontsize',
+ 'italics',
+ 'link',
+ 'small',
+ 'strike',
+ 'sub',
+ 'sup',
+ ];
+ for (var name of methodNames) {
+ calls = 0;
+ String.prototype[name].call(obj);
+ assertEquals(1, calls);
+ }
+})();
« no previous file with comments | « src/string.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698