michael@0: // Simple Debugger.Frame.prototype.onStep test. michael@0: // Test that onStep fires often enough to see all four values of a. michael@0: michael@0: var g = newGlobal(); michael@0: g.a = 0; michael@0: g.eval("function f() {\n" + michael@0: " a += 2;\n" + michael@0: " a += 2;\n" + michael@0: " a += 2;\n" + michael@0: " return a;\n" + michael@0: "}\n"); michael@0: michael@0: var dbg = Debugger(g); michael@0: var seen = [0, 0, 0, 0, 0, 0, 0]; michael@0: dbg.onEnterFrame = function (frame) { michael@0: frame.onStep = function () { michael@0: assertEq(arguments.length, 0); michael@0: assertEq(this, frame); michael@0: seen[g.a] = 1; michael@0: }; michael@0: } michael@0: michael@0: g.f(); michael@0: assertEq(seen.join(""), "1010101");