blob: e004b88ab7ea8850d257020f23182e1c32ada6ce [file] [log] [blame]
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
const isConstructor = $vm.createBuiltin("(function (c) { return @isConstructor(c); })");
var object1 = $vm.SimpleObject();
var object2 = $vm.SimpleObject();
function test(object) {
object.hey = 42; // Emit CheckStructure.
return isConstructor(object);
}
noInline(test);
for (let i = 0; i < 1e4; ++i) {
shouldBe(test(object1), true);
shouldBe(test(object2), true);
}