mirror of https://github.com/tc39/test262.git
20 lines
395 B
JavaScript
20 lines
395 B
JavaScript
function shouldBe(actual, expected)
|
|
{
|
|
if (actual !== expected)
|
|
throw new Error('bad value: ' + actual);
|
|
}
|
|
noInline(shouldBe);
|
|
|
|
function test(value)
|
|
{
|
|
return Object.prototype.toString.call(value);
|
|
}
|
|
noInline(test);
|
|
|
|
for (var i = 0; i < 1e6; ++i) {
|
|
if (i & 0x1)
|
|
shouldBe(test(null), `[object Null]`);
|
|
else
|
|
shouldBe(test(undefined), `[object Undefined]`);
|
|
}
|