Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promise-manipulation shorthands have underdefined behavior #52

Closed
bzbarsky opened this issue Nov 30, 2016 · 6 comments
Closed

Promise-manipulation shorthands have underdefined behavior #52

bzbarsky opened this issue Nov 30, 2016 · 6 comments

Comments

@bzbarsky
Copy link

https://www.w3.org/2001/tag/doc/promises-guide#shorthand-manipulating says:

If the algorithm using these shorthands is running in parallel, the shorthands queue a task on p’s relevant settings object’s responsible event loop to call the stored function.

But to queue a task you need to know the event loop and the task queue to use. Which task queue is used here?

@annevk
Copy link
Member

annevk commented Nov 30, 2016

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.

@domenic
Copy link
Member

domenic commented Jun 20, 2017

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.

@bzbarsky
Copy link
Author

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.

@domenic
Copy link
Member

domenic commented Jun 21, 2017

Good point, I got confused because my first example was a sequence of strings. I'll work to rephrase whatwg/html#2774.

@bzbarsky
Copy link
Author

Right, sequences have the same problem as dictionaries...

@domenic
Copy link
Member

domenic commented Aug 29, 2019

Fixed by whatwg/webidl#490!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants