Debian Codegraph @

js/src/jit-test/tests/proxy/testDirectProxyDefineProperty7.js

raw
1 // Bug 1133085 - Test that descriptors are properly reconstituted
2 // when only .get or only .set is present.
3
4 load(libdir + "asserts.js");
5
6 var input, output;
7 var p = new Proxy({x: 0}, {
8 defineProperty(t, k, desc) { output = desc; print("ok"); return true; }
9 });
10
11 input = {get: function () {}};
12 Object.defineProperty(p, "x", input);
13 assertDeepEq(output, input);
14
15 input = {set: function () {}};
16 Object.defineProperty(p, "x", input);
17 assertDeepEq(output, input);