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

Open
bzbarsky opened this Issue Nov 30, 2016 · 5 comments

Comments

Projects
None yet
3 participants
@bzbarsky

bzbarsky commented Nov 30, 2016

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

bzbarsky commented Jun 21, 2017

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

This comment has been minimized.

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

This comment has been minimized.

bzbarsky commented Jun 21, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment