3 <script type=
"text/javascript" charset=
"utf-8">
6 document.getElementById('console').appendChild(document.createTextNode(msg + '\n'));
9 function test(element, name)
12 for (prop in element) {
13 if (prop ==
"toString")
17 log(
"PASS: the toString function is not enumerable for " + name +
".");
19 log(
"FAIL: the toString function is enumerable for " + name +
" and should not be.");
24 if (window.testRunner)
25 testRunner.dumpAsText();
27 // DOM objects with custom toString() functions
28 test(document.createElement('a'),
"HTMLAnchorElement");
29 test(window.location,
"Location");
30 test(window.getSelection(),
"Selection");
33 test(document.createElement('div'),
"HTMLDivElement");
34 test(document,
"HTMLDocument");
42 <body onload=
"runTests();">
43 <p>This tests that the toString() function does not enumerate.
</p>
44 <pre id=
"console"></pre>