summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Object-defineProperty-07.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/debug/Object-defineProperty-07.js')
-rw-r--r--js/src/jit-test/tests/debug/Object-defineProperty-07.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/Object-defineProperty-07.js b/js/src/jit-test/tests/debug/Object-defineProperty-07.js
new file mode 100644
index 0000000000..8565c47357
--- /dev/null
+++ b/js/src/jit-test/tests/debug/Object-defineProperty-07.js
@@ -0,0 +1,10 @@
+// obj.defineProperty throws if a value, getter, or setter is not a debuggee value.
+
+load(libdir + "asserts.js");
+var g = newGlobal({newCompartment: true});
+var dbg = new Debugger;
+var gobj = dbg.addDebuggee(g);
+assertThrowsInstanceOf(function () { gobj.defineProperty('x', {value: {}}); }, TypeError);
+assertThrowsInstanceOf(function () { gobj.defineProperty('x', {get: Number}); }, TypeError);
+assertThrowsInstanceOf(function () { gobj.defineProperty('x', {get: gobj, set: Number}) },
+ TypeError);