blob: 3f0294bffa7d6946b9197269df80e1ea7f8c9c1c [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
</head>
<body>
<script>
// Force the window into cacheable dictionary mode.
for (var i = 0; i < 100; ++i)
window["p" + i] = i;
var foo = function(o) {
return o.screenX;
};
var test = function(id, x)
{
var niters = 100000;
var sum = 0;
for (var i = 0; i < niters; ++i)
sum += foo(window);
if (sum !== x * niters)
throw new Error("Incorrect sum for " + id);
}
var x = window.screenX;
test("x", x);
var newX = window.screenX + 1;
window.screenX = newX;
test("newX", newX);
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>