chromium/third_party/blink/web_tests/fast/js/pic/rehash-poisons-structure.html

<p>
This page tests a specific set of conditions that could cause a property map to
rehash, giving two objects with equal structure ID's unequal structures. If the
test passes, you'll see a PASS message below.
</p>

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

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

    function log(s)
    {
        if (this.document)
            document.getElementById("console").appendChild(document.createTextNode(s + "\n"));
        else
            print(s + "\n");
    }
    
    function shouldBe(a, aDescription, b)
    {
        if (a === b) {
            log("PASS: " + aDescription + " should be " + b + " and is.");
        } else {
            log("FAIL: " + aDescription + " should be " + b + " but instead is " + a + ".");
        }
    }
    
    function getP7(o)
    {
        return o.p7;
    }

    var o = {
        p1: 1,
        p2: 1,
        p3: 1,
        p4: 1,
        p5: 1,
        p6: 1,
        p7: 1,
        p8: 1
    };
    
    o.p7 = 1;

    var o2 = {
        p1: 1,
        p2: 1,
        p3: 1,
        p4: 1,
        p5: 1,
        p6: 1,
        p7: 1,
        p8: 1
    };

    getP7(o);
    getP7(o);

    shouldBe(getP7(o) == getP7(o2), "getP7(o) == getP7(o2)", true);
})();
</script>