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

http://github.com/zpao/v8monkey · JavaScript · 19 lines · 16 code · 2 blank · 1 comment · 0 complexity · 02502efc1f730ff136906af0d30c50b0 MD5 · raw file

  1. // Object arguments.
  2. var g = newGlobal('new-compartment');
  3. var dbg = new Debugger(g);
  4. var hits = 0;
  5. dbg.onDebuggerStatement = function (frame) {
  6. var args = frame.arguments;
  7. assertEq(args, frame.arguments);
  8. assertEq(args instanceof Array, true);
  9. assertEq(args.length, 2);
  10. assertEq(args[0] instanceof Debugger.Object, true);
  11. assertEq(args[0].class, args[1]);
  12. hits++;
  13. };
  14. g.eval("function f(obj, cls) { debugger; }");
  15. g.eval("f({}, 'Object');");
  16. g.eval("f(Date, 'Function');");
  17. assertEq(hits, 2);