]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/to-string-on-object-or-string.js
43638c14cf1ed67154317af8adaa0a0e8fec716d
   3 Foo
.prototype.toString = function() { return "hello" }; 
  11 for (var i 
= 0; i 
< 100000; ++i
) { 
  12     var result 
= foo(new Foo()); 
  13     if (typeof result 
!= "string") { 
  15         throw "Error: result isn't a string"; 
  17     if (result 
!= "hello") 
  18         throw "Error: bad result: " + result
; 
  20     result 
= foo("world"); 
  21     if (typeof result 
!= "string") { 
  23         throw "Error: result isn't a string"; 
  25     if (result 
!= "world") 
  26         throw "Error: bad result: " + result
;