on master help sign in
Debugger: fix restart().
403f86aLaszlo Pandy
runtime/Debugger.js+7−4
@@ -87,7 +87,8 @@ function debugModule(module, runtime) {
87 tracePath.stopRecording();
87 tracePath.stopRecording();
88 }
88 }
89 else {
89 else {
90+ // executeCallbacks should only be called when continuing, not when restarting.
90− executeCallbacks(asyncCallbacks);
91+ //executeCallbacks(asyncCallbacks, false);
91 tracePath.startRecording();
92 tracePath.startRecording();
92 }
93 }
93 }
94 }
@@ -142,8 +143,10 @@ function debuggerInit(debugModule, runtime) {
142
143
143 function restartProgram() {
144 function restartProgram() {
144 resetProgram();
145 resetProgram();
146+ debugModule.tracePath.clearTraces();
145 debugModule.clearRecordedEvents();
147 debugModule.clearRecordedEvents();
148+ debugModule.setPaused(false);
146− executeCallbacks(debugModule.initialAsyncCallbacks);
149+ executeCallbacks(debugModule.initialAsyncCallbacks, true);
147 }
150 }
148
151
149 function pauseProgram() {
152 function pauseProgram() {
@@ -328,9 +331,9 @@ function tracePathInit(runtime) {
328}
331}
329
332
330
333
331−function executeCallbacks(callbacks) {
334+function executeCallbacks(callbacks, reexecute) {
332 callbacks.forEach(function(timer) {
335 callbacks.forEach(function(timer) {
333− if (!timer.executed) {
336+ if (reexecute || !timer.executed) {
334 var func = timer.func;
337 var func = timer.func;
335 func();
338 func();
336 }
339 }