non-self referencial cyclical promises?
Benjamin Gruenbaum
benjamingr at gmail.com
Thu Feb 25 08:21:10 UTC 2016
Sorry, the example fiddle was before the inclusion of bluebird - I got
confused by the UI. Here: https://jsfiddle.net/cm9kvLqv/
It appears like native chrome promises also detect it (although with a less
informative error and only for one of the promises)
On Thu, Feb 25, 2016 at 10:17 AM, Benjamin Gruenbaum <benjamingr at gmail.com>
wrote:
> For what it's worth, bluebird promises detect the error and reject with:
>
> ```
> TypeError: Chaining cycle detected for promise #<Promise>
> ```
>
> So it's both possible and not a performance issue. For this case, a
> WeakMap is not needed for this case. https://jsfiddle.net/41ez2b6d/ .
>
>
> > We ran into code "in the wild"
>
> Yes, while I've never run into this I've talked to several people who have
> ran into this error - so it's definitely "a thing".
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160225/66d723c8/attachment.html>
More information about the es-discuss
mailing list