summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Source-element-05.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/debug/Source-element-05.js')
-rw-r--r--js/src/jit-test/tests/debug/Source-element-05.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/Source-element-05.js b/js/src/jit-test/tests/debug/Source-element-05.js
new file mode 100644
index 0000000000..702a6ef712
--- /dev/null
+++ b/js/src/jit-test/tests/debug/Source-element-05.js
@@ -0,0 +1,11 @@
+// source.element is undefined when bad values are passed to evaluate().
+
+var g = newGlobal({newCompartment: true});
+var dbg = new Debugger;
+var gw = dbg.addDebuggee(g);
+
+for (let nonObject of [32, "[object Object]", null, undefined]) {
+ g.evaluate("function f(x) { return 2*x; }", {element: nonObject});
+ var fw = gw.getOwnPropertyDescriptor('f').value;
+ assertEq(fw.script.source.element, undefined);
+}