From 7efbf72f03c2ff4878692eb0e1e4e3d4452751b5 Mon Sep 17 00:00:00 2001 From: Max Sorensen Date: Mon, 27 Jul 2015 16:00:18 +1000 Subject: [PATCH 1/2] detectSeries() iterator does not have to return a promise. --- async.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/async.coffee b/async.coffee index 06f5258..b33d679 100644 --- a/async.coffee +++ b/async.coffee @@ -90,7 +90,7 @@ module.exports = async = detectSeries: Q.promised (arr, iterator, _notFound=undefined) -> return Q _notFound if arr.length is 0 - iterator(arr[0]).then (ok) -> + Q(iterator(arr[0])).then (ok) -> if ok arr[0] else From 8f72b0a9fa714dbba6143ac7c6a2af785ec01f47 Mon Sep 17 00:00:00 2001 From: Max Sorensen Date: Mon, 27 Jul 2015 16:01:05 +1000 Subject: [PATCH 2/2] _notFound passed through subsequent iterations of detectSeries() --- async.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/async.coffee b/async.coffee index b33d679..5af80fe 100644 --- a/async.coffee +++ b/async.coffee @@ -94,7 +94,7 @@ module.exports = async = if ok arr[0] else - async.detectSeries arr[1..], iterator + async.detectSeries arr[1..], iterator, _notFound # [a] -> (a -> P b) -> [a] # basically a swartzian transform