diff --git a/Foundation/CPRunLoop.j b/Foundation/CPRunLoop.j index 20c52f0ea..9ced58b03 100644 --- a/Foundation/CPRunLoop.j +++ b/Foundation/CPRunLoop.j @@ -349,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() { _effectiveDate = nextFireDate; _nativeTimersForModes[aMode] = nil; ++CPRunLoopLastNativeRunLoop; [self limitDateForMode:aMode]; _effectiveDate = nil; }, [nextFireDate timeIntervalSinceNow] * 1000); + _nativeTimersForModes[aMode] = window.setNativeTimeout(function() { _effectiveDate = nextFireDate; _nativeTimersForModes[aMode] = nil; ++CPRunLoopLastNativeRunLoop; [self limitDateForMode:aMode]; _effectiveDate = nil; }, MAX(0, [nextFireDate timeIntervalSinceNow] * 1000)); } // Run loop performers