on master help sign in
fixed off-track backstep after a while.
commit021af44bf7ca470f7bc5851b476800970485b1b0 authorMichael James <michael@michaelbjames.com> dateThu 24 Jul 2014, 10:49 (12 years ago) parent180d998
1 file changed+6−4
runtime/Debugger.js+6−4
runtime/Debugger.js+6−4
@@ -83,11 +83,12 @@ function debugModule(module, runtime) {
8383 else {
8484 var changed = runtime.notify(id, v, timestep);
8585 recordEvent(id, v, timestep);
86− if (eventsUntilSnapshot <= 1) {
86+ if (eventsUntilSnapshot === 1) {
8787 saveSnapshot();
8888 eventsUntilSnapshot = EVENTS_PER_SAVE;
89+ } else {
90+ eventsUntilSnapshot -= 1;
8991 }
90− eventsUntilSnapshot -= 1;
9192 if (parent.window) {
9293 parent.window.postMessage("elmNotify", window.location.origin);
9394 }
@@ -319,11 +320,12 @@ function debuggerInit(debugModule, runtime, hotSwapState /* =undefined */) {
319320 while(currentEventIndex < index) {
320321 var nextEvent = debugModule.getRecordedEventAt(currentEventIndex);
321322 runtime.notify(nextEvent.id, nextEvent.value, nextEvent.timestep);
322− if (eventsUntilSnapshot <= 1) {
323+ if (eventsUntilSnapshot === 1) {
323324 debugModule.saveSnapshot();
324325 eventsUntilSnapshot = EVENTS_PER_SAVE;
326+ } else {
327+ eventsUntilSnapshot -= 1;
325328 }
326− eventsUntilSnapshot -= 1;
327329 currentEventIndex += 1;
328330 }
329331 debugModule.tracePath.stopRecording();