on master help sign in
continueAt(0) logic ameliorated
62b11fcMichael James
runtime/Debugger.js+2−6
@@ -181,8 +181,8 @@ function debugModule(module, runtime) {
181 eventsUntilSnapshot = EVENTS_PER_SAVE - (position % EVENTS_PER_SAVE);
181 eventsUntilSnapshot = EVENTS_PER_SAVE - (position % EVENTS_PER_SAVE);
182 snapshots = snapshots.slice(0, lastSnapshotPosition + 1);
182 snapshots = snapshots.slice(0, lastSnapshotPosition + 1);
183
183
184− if (position > 0) {
184+ if (position < getRecordedEventsLength()) {
185− var lastEventTime = recordedEvents[position-1].timestep;
185+ var lastEventTime = recordedEvents[position].timestep;
186 var scrubTime = runtime.timer.now() - lastEventTime;
186 var scrubTime = runtime.timer.now() - lastEventTime;
187 runtime.timer.addDelay(scrubTime);
187 runtime.timer.addDelay(scrubTime);
188 }
188 }
@@ -251,10 +251,6 @@ function debuggerInit(debugModule, runtime, hotSwapState /* =undefined */) {
251 function continueProgram() {
251 function continueProgram() {
252 if (debugModule.getPaused())
252 if (debugModule.getPaused())
253 {
253 {
254− if (currentEventIndex === 0) {
255− restartProgram();
256− return;
257− }
258 var closestSnapshotIndex =
254 var closestSnapshotIndex =
259 Math.floor(currentEventIndex / EVENTS_PER_SAVE) * EVENTS_PER_SAVE;
255 Math.floor(currentEventIndex / EVENTS_PER_SAVE) * EVENTS_PER_SAVE;
260 resetProgram(currentEventIndex);
256 resetProgram(currentEventIndex);