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); |
+ } |
+})(); |