summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/function-apply-proxy.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/basic/function-apply-proxy.js')
-rw-r--r--js/src/jit-test/tests/basic/function-apply-proxy.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/function-apply-proxy.js b/js/src/jit-test/tests/basic/function-apply-proxy.js
new file mode 100644
index 000000000..9a00fdb3d
--- /dev/null
+++ b/js/src/jit-test/tests/basic/function-apply-proxy.js
@@ -0,0 +1,26 @@
+// fun.apply(null, proxy) should not invoke the proxy's Has trap.
+
+var proxy = new Proxy({}, {
+ get: function (target, name, proxy) {
+ switch (name) {
+ case "length":
+ return 2;
+ case "0":
+ return 15;
+ case "1":
+ return undefined;
+ default:
+ assertEq(false, true);
+ }
+ },
+ has: function (target, name) {
+ assertEq(false, true);
+ }
+});
+function foo() {
+ assertEq(arguments.length, 2);
+ assertEq(arguments[0], 15);
+ assertEq(1 in arguments, true);
+ assertEq(arguments[1], undefined);
+}
+foo.apply(null, proxy);