michael@0: // vim: set ts=8 sts=4 et sw=4 tw=99: michael@0: michael@0: function testUKeyUObject(a, key1, key2, key3) { michael@0: a.a = function () { return this.d; } michael@0: a.b = function () { return this.e; } michael@0: a.c = function() { return this.f; } michael@0: a.d = 20; michael@0: a.e = "hi"; michael@0: a.f = 500; michael@0: delete a["b"]; michael@0: Object.defineProperty(a, "b", { get: function () { return function () { return this.e; } } }); michael@0: assertEq(a[key1](), 20); michael@0: assertEq(a[key2](), "hi"); michael@0: assertEq(a[key3](), 500); michael@0: } michael@0: michael@0: for (var i = 0; i < 5; i++) michael@0: testUKeyUObject({}, "a", "b", "c"); michael@0: michael@0: