Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:280north/cappuccino
Browse files Browse the repository at this point in the history
  • Loading branch information
Francisco Ryan Tolmasky I committed Dec 10, 2008
2 parents 6925bfd + 2d9d9f3 commit b87493b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Foundation/CPRunLoop.j
Expand Up @@ -151,6 +151,7 @@ var CPRunLoopLastNativeRunLoop = 0;
Object _nativeTimersForModes;
CPDate _nextTimerFireDatesForModes;
BOOL _didAddTimer;
CPDate _effectiveDate;

CPArray _orderedPerforms;
}
Expand Down Expand Up @@ -276,7 +277,7 @@ var CPRunLoopLastNativeRunLoop = 0;

_runLoopLock = YES;

var now = [CPDate date],
var now = _effectiveDate ? [_effectiveDate laterDate:[CPDate date]] : [CPDate date],
nextFireDate = nil,
nextTimerFireDate = _nextTimerFireDatesForModes[aMode];

Expand Down Expand Up @@ -348,7 +349,7 @@ var CPRunLoopLastNativeRunLoop = 0;

//initiate a new window.setTimeout if there are any timers
if (_nextTimerFireDatesForModes[aMode] !== nil)
_nativeTimersForModes[aMode] = window.setNativeTimeout(function() { _nativeTimersForModes[aMode] = nil; ++CPRunLoopLastNativeRunLoop; [self limitDateForMode:aMode]; _isNativeTimerRun = NO; }, MAX(0, [nextFireDate timeIntervalSinceNow] * 1000));
_nativeTimersForModes[aMode] = window.setNativeTimeout(function() { _effectiveDate = nextFireDate; _nativeTimersForModes[aMode] = nil; ++CPRunLoopLastNativeRunLoop; [self limitDateForMode:aMode]; _effectiveDate = nil; }, [nextFireDate timeIntervalSinceNow] * 1000);
}

// Run loop performers
Expand Down

0 comments on commit b87493b

Please sign in to comment.