@@ -40,7 +40,6 @@ function debugModule(module, runtime) {
40 var recordedEvents = [];
40 var recordedEvents = [];
41 var asyncCallbacks = [];
41 var asyncCallbacks = [];
42 var watchTracker = Elm.Native.Debug.make(runtime).watchTracker;
42 var watchTracker = Elm.Native.Debug.make(runtime).watchTracker;
44 var now = 0;
43 var now = 0;
46 function wrapNotify(id, v) {
45 function wrapNotify(id, v) {
@@ -70,7 +69,7 @@ function debugModule(module, runtime) {
70 var cbObj = { func:func, delayMs:delayMs, timerId:0, executed:false };
69 var cbObj = { func:func, delayMs:delayMs, timerId:0, executed:false };
71 var timerId = setTimeout(function() {
70 var timerId = setTimeout(function() {
72 cbObj.executed = true;
71 cbObj.executed = true;
73− func(timerOffset);
72+ func();
74 }, delayMs);
73 }, delayMs);
75 cbObj.timerId = timerId;
74 cbObj.timerId = timerId;
76 asyncCallbacks.push(cbObj);
75 asyncCallbacks.push(cbObj);
@@ -110,10 +109,6 @@ function debugModule(module, runtime) {
110 recordedEvents = events.slice();
109 recordedEvents = events.slice();
113− function resetTimeOffset() {
117 function setPaused() {
112 function setPaused() {
118 programPaused = true;
113 programPaused = true;
119 clearAsyncCallbacks();
114 clearAsyncCallbacks();
@@ -122,13 +117,14 @@ function debugModule(module, runtime) {
124 function setContinue(position) {
119 function setContinue(position) {
125− timerOffset += Date.now() - now;
120+ var timerDelay = Date.now() - now;
121+ Elm.timer.addDelay(timerDelay);
126 programPaused = false;
122 programPaused = false;
127 if (position > 0) {
123 if (position > 0) {
128 // If we're not unpausing at the head, then we need to dump the
124 // If we're not unpausing at the head, then we need to dump the
129 // events that are ahead of where we're continuing.
125 // events that are ahead of where we're continuing.
130 recordedEvents = recordedEvents.slice(0,position);
126 recordedEvents = recordedEvents.slice(0,position);
131− executeCallbacks(asyncCallbacks, false, timerOffset);
127+ executeCallbacks(asyncCallbacks, false);
133 tracePath.startRecording();
129 tracePath.startRecording();
@@ -173,7 +169,6 @@ function debugModule(module, runtime) {
173 getRecordedEventAt: getRecordedEventAt,
169 getRecordedEventAt: getRecordedEventAt,
174 copyRecordedEvents: copyRecordedEvents,
170 copyRecordedEvents: copyRecordedEvents,
175 loadRecordedEvents: loadRecordedEvents,
171 loadRecordedEvents: loadRecordedEvents,
176− resetTimeOffset: resetTimeOffset,
177 getPaused: getPaused,
172 getPaused: getPaused,
178 setPaused: setPaused,
173 setPaused: setPaused,
179 setContinue: setContinue,
174 setContinue: setContinue,
@@ -197,8 +192,7 @@ function debuggerInit(debugModule, runtime, hotSwapState /* =undefined */) {
197 debugModule.tracePath.clearTraces();
192 debugModule.tracePath.clearTraces();
198 debugModule.clearRecordedEvents();
193 debugModule.clearRecordedEvents();
199 debugModule.setContinue(0);
194 debugModule.setContinue(0);
200− debugModule.resetTimeOffset();
201− executeCallbacks(debugModule.initialAsyncCallbacks, true, 0);
195+ executeCallbacks(debugModule.initialAsyncCallbacks, true);
204 function pauseProgram() {
198 function pauseProgram() {
@@ -453,12 +447,12 @@ function tracePathInit(runtime, mainNode) {
456−function executeCallbacks(callbacks, reexecute, offset) {
450+function executeCallbacks(callbacks, reexecute) {
457 callbacks.forEach(function(timer) {
451 callbacks.forEach(function(timer) {
458 if (reexecute || !timer.executed) {
452 if (reexecute || !timer.executed) {
459 var func = timer.func;
453 var func = timer.func;
460 timer.executed = true;
454 timer.executed = true;
461− func(offset);
455+ func();