Closed bzbarsky closed 5 years ago
I think I mentioned this somewhere as a reason that this guide basically cannot be used directly by specifications.
@tobie or someone else should take the time to integrate it into IDL as only IDL-derived specifications will be in need of this kind of language.
Another issue is that people often want to use them on Web IDL objects, which are realm-agnostic. But we need to call the ES-spec algorithms with JS objects, which are not. So we need a specific global in which to do the conversion from IDL object -> JS object conversion.
I was going to say that this should be the global of the promise by default, to save people typing. But then I remembered that promises, as ES spec objects, don't have associated globals. So that's fun.
Web IDL objects are not realm-agnostic, if you mean platform objects. https://heycam.github.io/webidl/#es-platform-objects says:
Every platform object is associated with a global environment, just as the initial objects are. It is the responsibility of specifications using Web IDL to state which global environment (or, by proxy, which global object) each platform object is associated with.
and conversion to an ES object creates an ES object in that global (though this last part should probably be more clearly specified).
Now if you try to pass and IDL dictionary in, then you have a problem.
Good point, I got confused because my first example was a sequence of strings. I'll work to rephrase https://github.com/whatwg/html/pull/2774.
Right, sequences have the same problem as dictionaries...
https://www.w3.org/2001/tag/doc/promises-guide#shorthand-manipulating says:
But to queue a task you need to know the event loop and the task queue to use. Which task queue is used here?