mirror of
https://github.com/flynx/types.js.git
synced 2025-10-29 02:20:07 +00:00
notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
579fd05323
commit
0c492c7177
@ -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]) ?
|
||||
|
||||
@ -2117,6 +2117,9 @@ Note that if the last `<value>` is a function and no `<onerror>` function
|
||||
is given then `.awaitOrRun(..)` will confuse the `<value>` for `<func>`,
|
||||
to avoid this one needs to explicitly pass `null`/`undefined` as `<onerror>`.
|
||||
|
||||
_Special-case: this will expand async generators if they define `.then(..)`,
|
||||
this may change in the future._
|
||||
|
||||
|
||||
## Generator extensions and utilities
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user