blob: bc6a1928b36ec5a2d325288d1e8504e55744ec68 [file] [log] [blame]
// Only bool, undefined and null
function addNullBoolUndefined(a, b) {
return a + b;
}
noInline(addNullBoolUndefined);
for (var i = 0; i < 1e4; ++i) {
var value = addNullBoolUndefined(0.5, null);
if (value !== 0.5)
throw "addNullBoolUndefined(0.5, null) failed with i = " + i + " returned value = " + value;
var value = addNullBoolUndefined(null, undefined);
if (value === value)
throw "addNullBoolUndefined(null, undefined) failed with i = " + i + " returned value = " + value;
var value = addNullBoolUndefined(true, null);
if (value !== 1)
throw "addNullBoolUndefined(true, null) failed with i = " + i + " returned value = " + value;
var value = addNullBoolUndefined(undefined, false);
if (value === value)
throw "addNullBoolUndefined(undefined, false) failed with i = " + i + " returned value = " + value;
var value = addNullBoolUndefined(false, true);
if (value !== 1)
throw "addNullBoolUndefined(false, true) failed with i = " + i + " returned value = " + value;
var value = addNullBoolUndefined(null, 42);
if (value !== 42)
throw "addNullBoolUndefined(null, 42) failed with i = " + i + " returned value = " + value;
}