mirror of
https://github.com/tc39/test262.git
synced 2025-05-04 15:00:42 +02:00
22 lines
435 B
JavaScript
22 lines
435 B
JavaScript
function shouldBe(actual, expected) {
|
|
if (actual !== expected)
|
|
throw new Error('bad value: ' + actual);
|
|
}
|
|
noInline(shouldBe);
|
|
|
|
function test(object)
|
|
{
|
|
return 'return' in object;
|
|
}
|
|
noInline(test);
|
|
|
|
var object1 = {};
|
|
var object2 = { hello: 42 };
|
|
for (var i = 0; i < 10; ++i) {
|
|
shouldBe(test(object1), false);
|
|
}
|
|
for (var i = 0; i < 1e6; ++i) {
|
|
shouldBe(test(object1), false);
|
|
shouldBe(test(object2), false);
|
|
}
|