chromium/third_party/blink/web_tests/fast/js/toString-dontEnum.html

<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>