From 6a77aaab911b17db88b445d1e8d5efb0302f21fe Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 28 Dec 2022 20:58:16 +0300 Subject: [PATCH] ... Signed-off-by: Alex A. Naanou --- Promise.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Promise.js b/Promise.js index 1e14219..3b37836 100644 --- a/Promise.js +++ b/Promise.js @@ -337,13 +337,20 @@ object.Constructor('IterablePromise', Promise, { [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])]) + // 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) + // 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]) + // 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() + // await Promise.iter( + // ['a', 'b', 'c', [3,2,1], Promise.all([1,2,3])]) + // .flat() // XXX need a strict spec... return elem instanceof IterablePromise ? (elem.isSync() ?