$waitPromise should handle gracefully non promise.

This commit is contained in:
Julien Fontanet 2013-12-27 14:22:02 +01:00
parent 3bc345d391
commit 826add7b43

View File

@ -59,6 +59,9 @@ $waitEvent = (emitter, event) ->
# Waits for a promise to be fulfilled or broken.
$waitPromise = (promise) ->
# If it is not a promise, just forwards it.
return promise unless $isPromise promise
fiber = $fiber.current
promise.then(