diff --git a/Promise.js b/Promise.js index 8915b69..bce5f78 100644 --- a/Promise.js +++ b/Promise.js @@ -157,13 +157,16 @@ object.Constructor('IterablePromise', Promise, { return this.__handle(list.__packed, handler, onerror) } // handle promise / async-iterator... // XXX ITER do we unwind the iterator here or wait to unwind later??? - if(list instanceof Promise - || (typeof(list) == 'object' - && Symbol.asyncIterator in list)){ + if(typeof(list) == 'object' + && Symbol.asyncIterator in list){ return list .iter(handler, onerror) .then(function(list){ - return that.__pack(list) }) } + return that.__pack(list) }) + } else if(list instanceof Promise){ + return list + .then(function(list){ + return that.__pack(list, handler, onerror) }) } // do the work... // NOTE: packing and handling are mixed here because it's faster // to do them both on a single list traverse... diff --git a/package-lock.json b/package-lock.json index 885ae13..e19aa96 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ig-types", - "version": "6.24.5", + "version": "6.24.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ig-types", - "version": "6.24.5", + "version": "6.24.8", "license": "BSD-3-Clause", "dependencies": { "ig-object": "^6.0.0",