summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/proxy/testDirectProxyGet14.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/proxy/testDirectProxyGet14.js')
-rw-r--r--js/src/jit-test/tests/proxy/testDirectProxyGet14.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/proxy/testDirectProxyGet14.js b/js/src/jit-test/tests/proxy/testDirectProxyGet14.js
new file mode 100644
index 0000000000..c87c37b0de
--- /dev/null
+++ b/js/src/jit-test/tests/proxy/testDirectProxyGet14.js
@@ -0,0 +1,22 @@
+load(libdir + "asserts.js");
+
+var target = {x: 5};
+var returnValue = 42;
+var handler = {
+ get(t, p) {
+ return returnValue;
+ }
+};
+var {proxy, revoke} = Proxy.revocable(target, handler);
+
+function testGet(p) {
+ return p.x;
+}
+
+for (i = 0; i < 200; i++) {
+ assertEq(testGet(proxy), returnValue);
+}
+
+assertEq(testGet(proxy), returnValue);
+revoke();
+assertThrowsInstanceOf(function () { testGet(proxy) }, TypeError);