Add debug information

This commit is contained in:
cacaodev committed 2017-06-30 12:03:29 +02:00
1 parent b78e9062a1
commit 1ccec65619
1 file changed
+13
+13
View File
@@ -218,7 +218,12 @@ var _CPAnimationContextStack = nil,
if (_animationsByObject.size == 0)
{
if (_completionHandlerAgent)
{
#if (DEBUG)
CPLog.debug("No animations are scheduled. Firing completion handler");
#endif
_completionHandlerAgent.fire();
}
}
else
[self _startAnimations];
@@ -245,7 +250,12 @@ var _CPAnimationContextStack = nil,
if (_completionHandlerAgent)
{
if (n == 0)
{
#if (DEBUG)
CPLog.debug("Animations are not needed. Firing completion handler");
#endif
_completionHandlerAgent.fire();
}
else
_completionHandlerAgent.increment(n);
}
@@ -487,11 +497,14 @@ var _CPAnimationContextStack = nil,
@end
var COMPLETION_AGENT_ID = 0;
var CompletionHandlerAgent = function(aCompletionHandler)
{
this._completionHandler = aCompletionHandler;
this.total = 0;
this.valid = true;
this.id = COMPLETION_AGENT_ID++;
};
CompletionHandlerAgent.prototype.completionHandler = function()