summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Source-element-01.js
blob: 70c76bef0428067a79454683a0eedcd6d66a30c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Source.prototype.element can be an object or undefined.

var g = newGlobal();
var dbg = new Debugger;
var gw = dbg.addDebuggee(g);
g.evaluate("function f(x) { return 2*x; }", {element: { foo: "bar" }});
var fw = gw.getOwnPropertyDescriptor('f').value;
assertEq(typeof fw.script.source.element, "object");
assertEq(fw.script.source.element instanceof Debugger.Object, true);
assertEq(fw.script.source.element.getOwnPropertyDescriptor("foo").value, "bar");
g.evaluate("function f(x) { return 2*x; }");
var fw = gw.getOwnPropertyDescriptor('f').value;
assertEq(typeof fw.script.source.element, "undefined");