15:34
<nicolo-ribaudo>
Thanks to all those that voted! Multiple people int he comments suggested "only"; I edited the poll to also include that one. You can re-vote if you want, but I'll keep into account that the option was added later anyway. (I'll be on vacation the next two weeks, I'll then check the results when I'm back and present them to plenary :) ) https://docs.google.com/forms/d/e/1FAIpQLSfCURrVKg0R8e6AwO0M2eLRom2xi5sFCKB77l5Wlb0j7TlMEQ/viewform
22:30
<bakkot>
so, the thenable curtailment proposal offers an interesting new capability (for spec consumers): it detects whether user code might be involved in looking up .then; if the answer is no, then if you tack on a typeof (obj.then) !== 'function' then you can safely detect objects which definitely aren't thenables
22:31
<bakkot>
I am looking at this because in the async iterator helpers proposal I want to have a fast path for (at least) .filter(fn) where fn returns booleans; right now the fast path only works with primitives, buuuuuut we could extend it to almost all non-thenable objects using the above
22:31
<bakkot>
not particularly relevant for .filter but very relevant for .map
22:32
<bakkot>
fast path meaning, not awaiting the result of fn
22:33
<bakkot>
(which does not release zalgo because you're always going to be awaiting the result of the pull from upstream and returning a Promise, so this is about N->N-1 microtask turns, never N->0)
22:34
<bakkot>
interested to hear thoughts on this, particularly from people who care about Proxy transparency (since Proxies can never pass the "definitely not thenable" check)
22:47
<bakkot>

though I suppose since we're going to be invoking .then either way, we don't actually need the above check and could instead use a fast path along the lines of

if (val && typeof val === 'object') {
  const { then } = val;
  if (typeof then === 'function') {
    then.call(val, continuation);
  }
} else{
  continuation(val);
}