diff options
Diffstat (limited to 'js/src/jit-test/tests/proxy/testDirectProxyKeys6.js')
-rw-r--r-- | js/src/jit-test/tests/proxy/testDirectProxyKeys6.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/proxy/testDirectProxyKeys6.js b/js/src/jit-test/tests/proxy/testDirectProxyKeys6.js new file mode 100644 index 0000000000..00d97cbbca --- /dev/null +++ b/js/src/jit-test/tests/proxy/testDirectProxyKeys6.js @@ -0,0 +1,12 @@ +load(libdir + "asserts.js"); + +// Throw a TypeError if the trap skips a non-configurable enumerable property +var target = {}; +Object.defineProperty(target, 'foo', { + enumerable: true, + configurable: false +}); + +var handler = { ownKeys: () => [] }; +for (let p of [new Proxy(target, handler), Proxy.revocable(target, handler).proxy]) + assertThrowsInstanceOf(() => Object.keys(p), TypeError); |