| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
| <meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
| <title>test of bitwise operators mixing integers, null, and undefined</title> |
| .success { color: green; } |
| <script type="text/javascript"> |
| if (window.testRunner) testRunner.dumpAsText(); |
| document.getElementById("log").innerHTML += msg; |
| function logTest(expression, expected) { |
| result = eval(expression); |
| log("<li class='failure'>FAILED: " + expression + " = " + result + " -- expected: " + expected + "</li>"); |
| log("<li class='success'>SUCCESS: " + expression + " = " + result + "</li>"); |
| logTest("0 & undefined", 0); |
| logTest("1 & undefined", 0); |
| logTest("0 | undefined", 0); |
| logTest("1 | undefined", 1); |
| logTest("0 ^ undefined", 0); |
| logTest("1 ^ undefined", 1); |
| This tests the bitwise operators work correctly in conjunction with undefined and null.<br /> |
| <body onload="runTest()"> |