blob: 67a3c3196e855d665e68a7f7eca5ef031372930a [file] [log] [blame]
<html>
<head>
<script type="text/javascript" charset="utf-8">
function log(msg)
{
document.getElementById('console').appendChild(document.createTextNode(msg + '\n'));
}
function test(element, name)
{
var didPass = true;
for (prop in element) {
if (prop == "toString")
didPass = false;
}
if (didPass)
log("PASS: the toString function is not enumerable for " + name + ".");
else
log("FAIL: the toString function is enumerable for " + name + " and should not be.");
}
function runTests()
{
if (window.testRunner)
testRunner.dumpAsText();
// Other DOM objects
test(document.createElement('div'), "HTMLDivElement");
test(document, "HTMLDocument");
// JS objects
test({}, "Object");
test([], "Array");
}
</script>
</head>
<body onload="runTests();">
<p>This tests that the toString() function does not enumerate.</p>
<pre id="console"></pre>
</body>
</html>