summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Source-element-04.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/debug/Source-element-04.js')
-rw-r--r--js/src/jit-test/tests/debug/Source-element-04.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/Source-element-04.js b/js/src/jit-test/tests/debug/Source-element-04.js
new file mode 100644
index 0000000000..8aa0cfef3f
--- /dev/null
+++ b/js/src/jit-test/tests/debug/Source-element-04.js
@@ -0,0 +1,13 @@
+// source.element is undefined if the script was introduced using eval() or Function().
+
+var g = newGlobal({newCompartment: true});
+var dbg = new Debugger;
+var gw = dbg.addDebuggee(g);
+
+g.eval("function f(x) { return 2*x; }");
+var fw = gw.getOwnPropertyDescriptor('f').value;
+assertEq(fw.script.source.element, undefined);
+
+g.x = g.Function("return 13;");
+var xw = gw.getOwnPropertyDescriptor('x').value;
+assertEq(xw.script.source.element, undefined);