From 0c492c7177eda3c50c9be5bc9f5e84aa1ad0b171 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 8 Dec 2022 01:41:39 +0300 Subject: [PATCH] notes... Signed-off-by: Alex A. Naanou --- Promise.js | 2 ++ README.md | 3 +++ 2 files changed, 5 insertions(+) diff --git a/Promise.js b/Promise.js index 5d9a5cb..f48a8a8 100644 --- a/Promise.js +++ b/Promise.js @@ -1049,6 +1049,7 @@ object.Mixin('PromiseMixin', 'soft', { sync: SyncPromise, // XXX should this be implemented via SyncPromise??? // XXX not sure if we need to expand async generators... + // (update README if this changes) awaitOrRun: function(data, func, error){ data = [...arguments] func = data.pop() @@ -1073,6 +1074,7 @@ object.Mixin('PromiseMixin', 'soft', { // XXX not sure if we need to expand async generators... // ...since it has .then(..) it can be treated as a promise... // XXX should we just check for .then(..) ??? + // XXX update README if this changes... : (data.length == 1 && Symbol.asyncIterator in data[0] && 'then' in data[0]) ? diff --git a/README.md b/README.md index a382810..e39b375 100644 --- a/README.md +++ b/README.md @@ -2117,6 +2117,9 @@ Note that if the last `` is a function and no `` function is given then `.awaitOrRun(..)` will confuse the `` for ``, to avoid this one needs to explicitly pass `null`/`undefined` as ``. +_Special-case: this will expand async generators if they define `.then(..)`, +this may change in the future._ + ## Generator extensions and utilities