summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/proxy/testDirectProxyGet15.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/proxy/testDirectProxyGet15.js')
-rw-r--r--js/src/jit-test/tests/proxy/testDirectProxyGet15.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/proxy/testDirectProxyGet15.js b/js/src/jit-test/tests/proxy/testDirectProxyGet15.js
new file mode 100644
index 0000000000..60b86feacf
--- /dev/null
+++ b/js/src/jit-test/tests/proxy/testDirectProxyGet15.js
@@ -0,0 +1,25 @@
+var target = {x: 5};
+var returnValue = 42;
+var handlerProto = {};
+var handler = {};
+handlerProto.get = function(t, p) {
+ return returnValue;
+}
+handler.foo = handlerProto.get;
+handler.__proto__ = handlerProto;
+
+var proxy = new Proxy(target, handler);
+
+function testGet(p) {
+ return p.x;
+}
+
+for (i = 0; i < 500; i++) {
+ assertEq(testGet(proxy), returnValue);
+}
+
+handlerProto.get = function() {
+ return returnValue - 1;
+}
+
+assertEq(testGet(proxy), returnValue - 1);