on master help sign in
logical improvement: always add a pause delay
05fe7e5Michael James
runtime/Debugger.js+4
@@ -43,6 +43,7 @@ function debugModule(module, runtime) {
43 var asyncCallbacks = [];
43 var asyncCallbacks = [];
44 var snapshots = [];
44 var snapshots = [];
45 var watchTracker = Elm.Native.Debug.make(runtime).watchTracker;
45 var watchTracker = Elm.Native.Debug.make(runtime).watchTracker;
46+ var pauseTime = 0;
46 var eventsUntilSnapshot = EVENTS_PER_SAVE;
47 var eventsUntilSnapshot = EVENTS_PER_SAVE;
47
48
48 // runtime is the prototype of wrappedRuntime
49 // runtime is the prototype of wrappedRuntime
@@ -166,9 +167,12 @@ function debugModule(module, runtime) {
166 programPaused = true;
167 programPaused = true;
167 clearAsyncCallbacks();
168 clearAsyncCallbacks();
168 tracePath.stopRecording();
169 tracePath.stopRecording();
170+ pauseTime = Date.now();
169 }
171 }
170
172
171 function setContinue(position) {
173 function setContinue(position) {
174+ var pauseDelay = Date.now() - pauseTime;
175+ runtime.timer.addDelay(pauseDelay);
172 programPaused = false;
176 programPaused = false;
173 if (position > 0) {
177 if (position > 0) {
174 // If we're not unpausing at the head, then we need to dump the
178 // If we're not unpausing at the head, then we need to dump the