summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/jaeger/testPropCallElem2.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/jaeger/testPropCallElem2.js')
-rw-r--r--js/src/jit-test/tests/jaeger/testPropCallElem2.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/jaeger/testPropCallElem2.js b/js/src/jit-test/tests/jaeger/testPropCallElem2.js
new file mode 100644
index 000000000..43f8efb0f
--- /dev/null
+++ b/js/src/jit-test/tests/jaeger/testPropCallElem2.js
@@ -0,0 +1,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");
+
+