blob: 7b952290685922e63b24987f6121e24a28295a0a [file] [log] [blame]
function shouldBe(actual, expected)
{
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
function test(set, flag)
{
var iterator = set.values();
iterator.next();
if (flag) {
OSRExit();
return iterator;
}
return iterator.next().done;
}
noInline(test);
var set = new Set([0]);
for (var i = 0; i < 1e5; ++i)
shouldBe(test(set, false), true);
var iterator = test(set, true);
shouldBe(iterator.__proto__, (new Set).values().__proto__);
shouldBe(iterator.next().done, true);