diff options
Diffstat (limited to 'js/src/jit-test/tests/debug/Object-defineProperty-12.js')
-rw-r--r-- | js/src/jit-test/tests/debug/Object-defineProperty-12.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/Object-defineProperty-12.js b/js/src/jit-test/tests/debug/Object-defineProperty-12.js new file mode 100644 index 000000000..84ec3fbb5 --- /dev/null +++ b/js/src/jit-test/tests/debug/Object-defineProperty-12.js @@ -0,0 +1,18 @@ +// obj.defineProperty redefining an existing property leaves unspecified attributes unchanged. + +var g = newGlobal(); +g.p = 1; +var dbg = new Debugger; +var gw = dbg.addDebuggee(g); + +gw.defineProperty("p", {value: 2}); +assertEq(g.p, 2); + +var desc = Object.getOwnPropertyDescriptor(g, "p"); +assertEq(desc.configurable, true); +assertEq(desc.enumerable, true); +assertEq(desc.writable, true); +assertEq(desc.value, 2); + +g.p = 3; +assertEq(g.p, 3); |