summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/proxy/testDirectProxyKeys1.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--js/src/jit-test/tests/proxy/testDirectProxyKeys1.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/proxy/testDirectProxyKeys1.js b/js/src/jit-test/tests/proxy/testDirectProxyKeys1.js
new file mode 100644
index 0000000000..2176850500
--- /dev/null
+++ b/js/src/jit-test/tests/proxy/testDirectProxyKeys1.js
@@ -0,0 +1,27 @@
+// Forward to the target if the trap is not defined
+var proto = Object.create(null, {
+ a: {
+ enumerable: true,
+ configurable: true
+ },
+ b: {
+ enumerable: false,
+ configurable: true
+ }
+});
+var target = Object.create(proto, {
+ c: {
+ enumerable: true,
+ configurable: true
+ },
+ d: {
+ enumerable: false,
+ configurable: true
+ }
+});
+
+for (let p of [new Proxy(target, {}), Proxy.revocable(target, {}).proxy]) {
+ var names = Object.keys(p);
+ assertEq(names.length, 1);
+ assertEq(names[0], 'c');
+}