PageRenderTime 19ms CodeModel.GetById 12ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/js/src/jit-test/tests/debug/Frame-evalWithBindings-05.js

http://github.com/zpao/v8monkey
JavaScript | 12 lines | 10 code | 1 blank | 1 comment | 0 complexity | 7e8af6a5438eecfb1bde1425dcb88f0b MD5 | raw file
 1// evalWithBindings code can assign to the bindings.
 2var g = newGlobal('new-compartment');
 3var dbg = new Debugger(g);
 4var hits = 0;
 5dbg.onDebuggerStatement = function (frame) {
 6    assertEq(frame.evalWithBindings("for (i = 0; i < 5; i++) {}  i;", {i: 10}).return, 5);
 7    hits++;
 8};
 9
10g.eval("debugger;");
11assertEq("i" in g, false);
12assertEq(hits, 1);