summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-arguments-02.js
blob: 145ec824d80b5767bae4cd8cb4b020f3cdb77af5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Object arguments.

var g = newGlobal({newCompartment: true});
var dbg = new Debugger(g);
var hits = 0;
dbg.onDebuggerStatement = function (frame) {
    var args = frame.arguments;
    assertEq(args, frame.arguments);
    assertEq(args instanceof Array, true);
    assertEq(args.length, 2);
    assertEq(args[0] instanceof Debugger.Object, true);
    assertEq(args[0].class, args[1]);
    hits++;
};

g.eval("function f(obj, cls) { debugger; }");
g.eval("f({}, 'Object');");
g.eval("f(Date, 'Function');");
assertEq(hits, 2);