/js/src/jit-test/tests/debug/Frame-onStep-resumption-01.js

http://github.com/zpao/v8monkey · JavaScript · 14 lines · 10 code · 3 blank · 1 comment · 0 complexity · ca4e9851d6e2f3395e99a83eaa702d25 MD5 · raw file

  1. // If frame.onStep returns {return:val}, the frame returns.
  2. var g = newGlobal('new-compartment');
  3. g.eval("function f(x) {\n" +
  4. " var a = x * x;\n" +
  5. " return a;\n" +
  6. "}\n");
  7. var dbg = Debugger(g);
  8. dbg.onEnterFrame = function (frame) {
  9. frame.onStep = function () { return {return: "pass"}; };
  10. };
  11. assertEq(g.f(4), "pass");