blob: d8cba2077884edb2d73cfc2cf7877d837b17d675 [file] [log] [blame]
<html>
<head>
<script src="../../../resources/js-test.js"></script>
</head>
<body style="margin: 0px">
<script>
shouldBeEqualToString("document.body.style.margin", "0px");
shouldBe("document.body.style.margin = 1", "1");
shouldBeEqualToString("document.body.style.margin", "1px");
var badString = { toString: function() { throw "Exception in toString()"; } };
shouldThrow("document.body.style.margin = badString", "'Exception in toString()'");
shouldBeEqualToString("document.body.style.margin", "1px"); // Should not reset the previous value.
// Creating a new property on prototype shadows the named property.
shouldBe("document.body.style.__proto__.margin = 2", "2");
shouldBe("document.body.style.__proto__.margin", "2");
shouldBeEqualToNumber("document.body.style.margin", 2);
shouldBe("document.body.style.margin = 3", "3");
shouldBeEqualToNumber("document.body.style.margin", 3);
</script>
</body>
</html>