summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/js/pic/get-empty-string.html
blob: a54875a8cf0d15bb842ae9d0c42c084924f3c0c2 (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
33
34
<p>
This page tests the empty string used as a property name. If the test passes,
you'll see a PASS message below.
</p>

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

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

(function() {
    function log(s)
    {
        if (this.document)
            document.getElementById("console").appendChild(document.createTextNode(s));
        else
            print(s);
    }
    
    function shouldBe(a, aDescription, b)
    {
        if (a === b) {
            log("PASS: " + aDescription + " should be " + b + " and is.\n");
        } else {
            log("FAIL: " + aDescription + " should be " + b + " but instead is " + a + ".\n");
        }
    }
    
    var o = { x: 1 };
    o[""] = 1;
    shouldBe(o[""], 'o[""]', 1);
})();
</script>