summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-arguments-02.js
blob: 697ccccbf4a8800d80f382524ebc650435c24049 (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();
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);