test262: Completion values for control flow do not match the spec
[WebKit-https.git] / LayoutTests / js / arity-mismatch-at-vmentry.html
1 <html>
2 <head>
3 <script src="../resources/js-test-pre.js"></script>
4 </head>
5 <body>
6 <span id="span">
7 <p id="description"></p>
8 <div id="console"></div>
9
10 <script>
11     description("This tests that vm entry to a JS function with arity mismatch doesn't crash (bug 136305).");
12
13     if (window.testRunner)
14         testRunner.waitUntilDone();
15
16     window.jsTestIsAsync = true;
17
18     function marsaglia(m_z, m_w, n) {
19         var result;
20         for (var i = 0; i < n; ++i) {
21         }
22     }
23
24     var result = 0;
25     for (var i = 0; i < 100; ++i)
26         result += marsaglia(i, i + 1, 1000000);
27
28     document.getElementById("span").addEventListener("readystatechange", marsaglia);
29
30     var dispatch_fn = function() {
31         evt = document.createEvent("Event");
32         evt.initEvent("readystatechange", false, false);
33         document.getElementById("span").dispatchEvent(evt);
34     }
35
36     window.setInterval(dispatch_fn, 0);
37     window.setTimeout('finishJSTest()', 1);
38 </script>
39
40 <script src="../resources/js-test-post.js"></script>
41 </body>
42 </html>