blob: 8fed9072fc9d423666d1e2d8f4ab7e04a41bf3df [file] [log] [blame]
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
var called = false;
Object.defineProperty(Symbol.prototype, Symbol.iterator, {
get() {
"use strict";
shouldBe(typeof this, "symbol");
called = true;
return null;
}
});
var symbol = Symbol("Cocoa");
{
called =false;
Array.from(symbol);
shouldBe(called, true);
}
{
called =false;
Uint8Array.from(symbol);
shouldBe(called, true);
}