blob: 3f11fc56dcef6704960c02e4bdf0a3fb0b7dc198 [file] [log] [blame]
description("document.all works as superclass.prototype, but not as superclass");
function testAsSuperclassPrototype() {
function Bar() {}
Bar.prototype = document.all;
for (let i = 0; i < 1e5; ++i) {
class Foo extends Bar {}
if (!(new Foo() instanceof Bar))
return false;
}
return true;
}
shouldBe("testAsSuperclassPrototype()", "true");
shouldThrow("class Foo extends document.all {}", "'TypeError: The superclass is not a constructor.'");