summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/constructors/constructor-as-function-crash.html
blob: 29e20d35b236d4c047565bb2ba6d64ae35110672 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<html>
<head>
    <title>Calling bindings constructors as function should not cause a crash</title>
    <script>
        if (window.layoutTestController)
            layoutTestController.dumpAsText();

        function runTest()
        {
            // List of constructors to test.
            var constructors = ["EventSource", "MessageChannel", "SharedWorker", "WebGLArrayBuffer", "WebKitCSSMatrix", "WebKitPoint", "WebSocket", "Worker", "XMLHttpRequest", "XSLTProcessor"];
            var result = document.getElementById("result");
            for (var i in constructors) {
                try {
                    var func = constructors[i] + "()";
                    eval(func);
                    result.innerHTML += "FAIL";
                }
                catch (e) {
                    result.innerHTML += "PASS";
                }
                result.innerHTML += ": " + constructors[i] + "<br/>";
            }
        }

    </script>
</head>
<body onload="runTest()">
    <p>Calling <code>bindings</code> constructors as function should throw an exception and not cause a crash.</p>
    <div id="result"></div>
</html>