blob: 03ada7aa0d4d43811652fc679a00a41b9653013d [file] [log] [blame]
<!DOCTYPE html>
<meta charset="utf-8">
<title>Interface prototype objects</title>
<link rel="help" href="https://heycam.github.io/webidl/#interface-prototype-object">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
// A specification issue was raised for this behavior.
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=28244
test(function() {
// Checks toString() behavior.
assert_class_string(Document.prototype, "DocumentPrototype");
assert_true(Document.prototype.hasOwnProperty(Symbol.toStringTag),
"An interface prototype object should have toStringTag property.");
assert_equals(Document.prototype[Symbol.toStringTag], "DocumentPrototype");
}, "The class string of an interface prototype object is the concatenation of " +
"the interface's identifier and the string 'Prototype'.");
test(function() {
// https://heycam.github.io/webidl/#create-an-interface-prototype-object
assert_own_property(Element.prototype, Symbol.unscopables, "Element.prototype has @@unscopables.");
let unscopables = Element.prototype[Symbol.unscopables];
assert_equals(typeof unscopables, "object", "@@unscopables is an Object.");
assert_equals(Object.getPrototypeOf(unscopables), null, "@@unscopables's prototype is null.");
}, "[Unscopable] extended attribute makes @@unscopables object on the prototype object, whose prototype is null.");
</script>