/js/src/jit-test/tests/debug/Object-02.js

http://github.com/zpao/v8monkey · JavaScript · 13 lines · 11 code · 1 blank · 1 comment · 0 complexity · 0cf14b73a58b3e4bf33d5c2b06ebd2f3 MD5 · raw file

  1. // Debugger.Object referents can be transparent wrappers of objects in the debugger compartment.
  2. var g = newGlobal('new-compartment');
  3. g.f = function (a, b) { return a + "/" + b; };
  4. var dbg = Debugger(g);
  5. var hits = 0;
  6. dbg.onDebuggerStatement = function (frame) {
  7. var f = frame.eval("f").return;
  8. assertEq(f.call(null, "a", "b").return, "a/b");
  9. hits++;
  10. };
  11. g.eval("debugger;");
  12. assertEq(hits, 1);