<!DOCTYPE html>
<html>
<body>
<script src="../../resources/js-test-pre.js"></script>
<script>

description("Tests what happens when you make prototype chain accesses with impure GetOwnPropertySlot traps in the way.");

Document.prototype.foo = function () {};

function f() {
    return document.foo;
}

var expected = "\"function\"";
for (var i = 0; i < 10; ++i) {
    if (i == 5) {
        var img = new Image();
        img.name = "foo";
        document.body.appendChild(img);
        expected = "\"object\"";
    }
    v = f();
    shouldBe("typeof f()", expected);
}

</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>
