PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/js/src/jit-test/tests/debug/onEnterFrame-06.js

http://github.com/zpao/v8monkey
JavaScript | 19 lines | 14 code | 3 blank | 2 comment | 0 complexity | 4b3e38aee5a9fa299d1089f036ee1889 MD5 | raw file
 1// The tracejit does not prevent onEnterFrame from being called after entering
 2// a debuggee compartment from a non-debuggee compartment.
 3
 4var g1 = newGlobal('new-compartment');
 5var g2 = newGlobal('new-compartment');
 6var dbg = Debugger(g1, g2);
 7dbg.removeDebuggee(g2); // turn off debug mode in g2
 8
 9g1.eval("function f() { return 1; }\n");
10var N = g1.N = 11;
11g1.eval("function h() {\n" +
12       "    for (var i = 0; i < N; i += f()) {}\n" +
13       "}");
14g1.h(); // record loop
15
16var log = '';
17dbg.onEnterFrame = function (frame) { log += frame.callee.name; };
18g1.h();
19assertEq(log, 'h' + Array(N + 1).join('f'));