00:07
<jmdyck>
What is a "promise-like object"? (https://tc39.es/ecma262/#sec-promisecapability-records is the only occurrence in the spec)
00:11
<bakkot>
it deliberately doesn't have a formal definition
00:13
<bakkot>
formally it ends up being anything which can be produced by a constructor which takes a callback as an argument and immediately invokes that callback with two arguments, both of which are callable
00:13
<bakkot>
but that's not, like, useful
00:13
<bakkot>
so you should think of it as a promise-like object
00:18
<jmdyck>
Seems like that generality (allowing a promise-like object) isn't propagated through the spec.
00:19
<bakkot>
do you have a concrete case in mind?
00:21
<jmdyck>
e.g. Evaluate for a Cyclic Module Record says it returns "a Promise", but 2 of its returns are returning a capability's [[Promise]] field, which might be a promise-like object (or are we somehow guaranteed that it isn't?)
00:22
<bakkot>
in that case the promise is generated by NewPromiseCapability(%Promise%), which does indeed create a capability which hold a genuine promise
00:22
<nicolo-ribaudo>
Step 6 of evaluate ensures that it's a real Promise, because it uses the %Promise% intrinsic. I think we can only get promise-likes when there are calls to NewPromiseCapability with user-provided consructors
00:24
<nicolo-ribaudo>
For example, PromiseSubclass.all will internally create a PromiseCapability Record containing an instance of PromiseSubclass, and will return that instance instead of a Promise
00:26
<nicolo-ribaudo>
We could link promise-like to step 2 of NewPromiseCapability, where it's defined (even if that step doesn't use the name promise-like)
00:51
<jmdyck>
So is there any spec algorithm that treats a promise-like object as something more than just an object?
01:03
<bakkot>
I don't believe so
01:18
<jmdyck>
okay, thanks.
16:18
<annevk>
How much support would there be for Float16Array? https://github.com/w3c/ColorWeb-CG/blob/master/canvas_float.md
16:19
<annevk>
It seems kinda silly to not use the most logical type because we don't have it in JS since JS is mutable...
16:19
annevk
finds https://github.com/w3c/ColorWeb-CG/issues/87
16:21
<littledan>
leobalter was involved in raising this before. Actually I was a little negative about it because there weren't clear performance benefits (given the need to make it a double in memory in practice) or web platform use cases. The champions were saying, we could use this for WebGL, but hadn't been in touch with the WebGL folks. Anyway if there actually is this kind of motivation, I think we could do this pretty quickly.
16:22
<littledan>
it's not so trivial to do anything with TypedArrays at all, implementation-wise, but we managed for BigInt64Array, so I think this should be possible, if implementations want to put in the effort.
16:23
<annevk>
Thanks for the assessment, I'll leave a comment about not shipping the org-chart
16:24
<littledan>
Yeah, if someone wants to champion Float16Array, I'd be happy to do reviews/mentor/etc, just let me know.
23:43
<TabAtkins>
Has there been a proposal for Set.toggle(val, bool?) ? (If bool is not present, it adds or removes the value as needed; if it's present, true adds the value and false removes it.)
23:43
<TabAtkins>
This is a useful bit of functionality attached to DOMTokenList (like el.classList) and it would be good to ensure that Sets are at least as functional.
23:47
<TabAtkins>
(I could try to look around, but if someone has a memory one way or the other it'll save me a lot of time.)