diff options
Diffstat (limited to 'js/src/jit-test/tests/proxy/testDirectProxyDefineProperty1.js')
-rw-r--r-- | js/src/jit-test/tests/proxy/testDirectProxyDefineProperty1.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/proxy/testDirectProxyDefineProperty1.js b/js/src/jit-test/tests/proxy/testDirectProxyDefineProperty1.js new file mode 100644 index 000000000..243ad55a1 --- /dev/null +++ b/js/src/jit-test/tests/proxy/testDirectProxyDefineProperty1.js @@ -0,0 +1,23 @@ +// Forward to the target if the trap is not defined + +var target; +function testProxy(p, key) { + Object.defineProperty(p, key, { + value: 'bar', + writable: true, + enumerable: false, + configurable: true + }); + var desc = Object.getOwnPropertyDescriptor(target, key); + assertEq(desc.value, 'bar'); + assertEq(desc.writable, true); + assertEq(desc.enumerable, false); + assertEq(desc.configurable, true); +} + +for (var key of ['foo', Symbol("quux")]) { + target = {}; + testProxy(new Proxy(target, {}), key); + target = {}; + testProxy(Proxy.revocable(target, {}).proxy, key); +} |