summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/jaeger/testPropCallElem2.js
blob: 43f8efb0fb579695afd806cb9098ff47fc32a424 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// vim: set ts=8 sts=4 et sw=4 tw=99:

function testUKeyUObject(a, key1, key2, key3) {
    a.a = function () { return this.d; }
    a.b = function () { return this.e; }
    a.c = function() { return this.f; }
    a.d = 20;
    a.e = "hi";
    a.f = 500;
    delete a["b"];
    Object.defineProperty(a, "b", { get: function () { return function () { return this.e; } } });
    assertEq(a[key1](), 20);
    assertEq(a[key2](), "hi");
    assertEq(a[key3](), 500);
}

for (var i = 0; i < 5; i++)
    testUKeyUObject({}, "a", "b", "c");