mirror of
https://github.com/flynx/types.js.git
synced 2025-10-29 02:20:07 +00:00
...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
e250a87ff4
commit
6a77aaab91
15
Promise.js
15
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() ?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user