blob: cd81762120a84b3f1f91ca593ae3ed97e150de6b [file] [log] [blame]
description(
"Tests that we do ToString conversions correctly when String.prototype.valueOf is not what we wanted."
);
String.prototype.toString = function() { return 42; }
function foo(a) {
for (var i = 0; i < 100; ++i)
a = new String(a);
return a;
}
for (var i = 0; i < 100; ++i)
shouldBe("\"\" + foo(\"hello\")", "\"42\"");