Add content test for [LenientThis] attribute Document.onreadystatechange

This commit is contained in:
Mukilan Thiyagarajan 2014-10-25 17:55:08 +05:30
parent e023662571
commit 9653965380

View file

@ -0,0 +1,28 @@
<html>
<head>
<script src="harness.js"></script>
<script>
var handler = function () { };
document.onreadystatechange = handler;
var obj = {};
// test1: basic test
{
var val = Object.getOwnPropertyDescriptor(Document.prototype, "onreadystatechange").get.call(document);
is(val, handler, "test1-0, basic test");
}
// test2: Should not throw for attribute marked "[LenientThis]"
{
should_not_throw(function () {
var val = null;
val = Object.getOwnPropertyDescriptor(Document.prototype, "onreadystatechange").get.call(obj);
is(val, undefined, "test2-0, calling getter returns undefined");
is(Document.prototype.onreadystatechange, undefined, "test2-1, property access returns undefined");
});
}
finish();
</script>
</head>
</html>