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