Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / js / vardecl-preserve-vardecl.html
blobeefee44a9df1ab7a3633f0d4f5618620cfe63193
1 <p>This test verifies that var declarations in different evaluation units don't stomp each other.</p>
2 <pre id="console"></pre>
4 <script>
5 if (window.testRunner)
6 testRunner.dumpAsText();
8 function log(s)
10 document.getElementById("console").appendChild(document.createTextNode(s + "\n"));
12 </script>
14 <script>
15 var x = 1;
16 y = 1;
17 </script>
19 <script>
20 var x;
21 var y;
23 if (x == 1)
24 log("PASS: x should be 1 and is.");
25 else
26 log("FAIL: x should be 1 but instead is " + x + ".");
28 if (y == 1)
29 log("PASS: y should be 1 and is.");
30 else
31 log("FAIL: y should be 1 but instead is " + y + ".");
32 </script>