summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/js/vardecl-preserve-parameters.html
blob: 672999d0eb162d42c2a51c2278356ddf6b89efe7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<p>This test verifies var declarations inside a function don't stomp function arguments.</p>

<pre id="console"></pre>

<script>
if (window.layoutTestController)
    layoutTestController.dumpAsText();

function log(s)
{
    document.getElementById("console").appendChild(document.createTextNode(s + "\n"));
}

function f(x)
{
    var x;
    if (x == 1)
        log("PASS: x should be 1 and is.");
    else
        log("FAIL: x should be 1 but instead is " + x + ".");
}
f(1);
</script>