blob: 81e1c210c976853c71b5c04505fce140f537a3cd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
function testNewString()
{
var o = { toString: function() { return "string"; } };
var r = [];
for (var i = 0; i < 5; i++)
r.push(typeof new String(o));
for (var i = 0; i < 5; i++)
r.push(typeof new String(3));
for (var i = 0; i < 5; i++)
r.push(typeof new String(2.5));
for (var i = 0; i < 5; i++)
r.push(typeof new String("string"));
for (var i = 0; i < 5; i++)
r.push(typeof new String(null));
for (var i = 0; i < 5; i++)
r.push(typeof new String(true));
for (var i = 0; i < 5; i++)
r.push(typeof new String(undefined));
return r.length === 35 && r.every(function(v) { return v === "object"; });
}
assertEq(testNewString(), true);
checkStats({
recorderStarted: 7,
recorderAborted: 0,
traceCompleted: 7,
sideExitIntoInterpreter: 7
});
|