From dcad00512e0f6e4a26478483151b4d9a48e3cd66 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sun, 25 Dec 2022 23:14:59 +0300 Subject: [PATCH] experimenting + notes... Signed-off-by: Alex A. Naanou --- Promise.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Promise.js b/Promise.js index e9204d3..0506381 100644 --- a/Promise.js +++ b/Promise.js @@ -336,6 +336,14 @@ object.Constructor('IterablePromise', Promise, { return list [map](function(elem){ //* XXX migrate code from old .__pack(..)... + // XXX these are not the same: + // await Promise.iter(['a', 'b', 'c', [3,2,1], Promise.all([1,2,3])]) + // and: + // await Promise.iter(['a', 'b', 'c', [3,2,1], Promise.all([1,2,3])], e => e) + // this produces the correct result: + // await Promise.iter(['a', 'b', 'c', [3,2,1], Promise.all([1,2,3])], e => [e]) + // this does not flatten the promise: + // await Promise.iter(['a', 'b', 'c', [3,2,1], Promise.all([1,2,3])]).flat() return elem instanceof IterablePromise ? (elem.isSync() ? handler(elem.sync())