js/src/jit-test/tests/debug/Frame-arguments-02.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/debug/Frame-arguments-02.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,19 @@
     1.4 +// Object arguments.
     1.5 +
     1.6 +var g = newGlobal();
     1.7 +var dbg = new Debugger(g);
     1.8 +var hits = 0;
     1.9 +dbg.onDebuggerStatement = function (frame) {
    1.10 +    var args = frame.arguments;
    1.11 +    assertEq(args, frame.arguments);
    1.12 +    assertEq(args instanceof Array, true);
    1.13 +    assertEq(args.length, 2);
    1.14 +    assertEq(args[0] instanceof Debugger.Object, true);
    1.15 +    assertEq(args[0].class, args[1]);
    1.16 +    hits++;
    1.17 +};
    1.18 +
    1.19 +g.eval("function f(obj, cls) { debugger; }");
    1.20 +g.eval("f({}, 'Object');");
    1.21 +g.eval("f(Date, 'Function');");
    1.22 +assertEq(hits, 2);

mercurial