1 g = { 'global noneval': 1 };
2 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
4 eval("g['global eval'] = 1");
6 // Function to step through and set breakpoints on
8 g['function noneval'] = 1;
9 eval("g['function eval'] = 1");
12 for (y = 0; y < 10; y++) {
15 for (y = 0; y < 3; y++) {
21 var f2 = new Function("g['function noneval'] = 2; eval(\"g['function eval'] = 2\")");
23 function testJSD(jsd) {
24 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
25 ok(jsd.isOn, "JSD needs to be running for this test.");
27 var numBreakpoints = 0;
31 jsd.topLevelHook = null;
32 jsd.functionHook = null;
33 dump("numGlobalNonevals="+numGlobalNonevals+"\n");
34 dump("numFunctionNonevals="+numFunctionNonevals+"\n");
35 dump("numGlobalEvals="+numGlobalEvals+"\n");
36 dump("numFunctionEvals="+numFunctionEvals+"\n");
38 ok(numFunctionNonevals == 3, "(fn) Should have hit f1(), testJSD(), and f2(); hit " + hits.fn);
39 ok(numGlobalNonevals == 1, "(gn) Overall script, hit " + hits.gn);
40 ok(numGlobalEvals == 1, "(ge) Eval in global area, hit " + hits.ge);
41 ok(numFunctionEvals == 2, "(fe) Evals within f1() and f2(), hit " + hits.fe);
44 // turn JSD off if it wasn't on when this test started
46 ok(!jsd.isOn, "JSD shouldn't be running at the end of this test.");