-
Notifications
You must be signed in to change notification settings - Fork 163
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
Import (and fix) the promises guide #490
Comments
Mmm. I was sure we already had an open issue for this but can't find it. |
It's not linked from w3ctag/promises-guide#27 (and now this is). |
As background, one of the major things wrong with the promises guide is that it was written before I was bought into the Web IDL ecosystem, so it tries to be usable from JS specs as well. A lot of the definitions take as arguments JS values or JS functions, whereas you really want to be using them with IDL values or lists of steps. https://www.w3.org/2001/tag/doc/promises-guide#shorthand-phrases is the section in question, mainly. Here is what I would do for this issue, if I had the time to do so.
I think this could be done relatively piecemeal. Some steps are definitely separable (e.g. fixing realm usage, separating two variants of resolve, maybe fixing the task-queuing). You could also do it definition by definition, if you were willing to add a warning to the promises guide saying "during the transition period, these not-yet-migrated definitions will sometimes be used on Web IDL promise types; if so, that roughly means this." |
This partially addresses #490 (comment).
This partially addresses #490 (comment).
Is there a way to get this record out of an arbitrary Promise object? I believe this would be needed for https://heycam.github.io/webidl/#es-to-promise (as it exists today), since |
It seems like using https://tc39.github.io/ecma262/#sec-createresolvingfunctions (and then adding a [[Promise]] field to the result) would work, although I'm a bit unsure about the consequences of a promise floating around with multiple resolve/reject functions associated with it (one from user code and one from the UA). Ideally UA code should not be resolving/rejecting user-provided promises. So maybe there is a better structure than the one I outlined above, hmm. For example, [[Resolve]] and [[Reject]] could be null for user-provided promises, and the first steps of "resolve a promise"/"reject a promise" could assert they are non-null, i.e. assert that the promise was UA-created and not user-created? |
The old anchor in the TAG's "Writing Promise-Using Specifications" no longer exists, as the text was moved to the WebIDL specification to fix whatwg/webidl#490. Reference the right spec to fix our validation checks.
* Fix reference to "a new promise". The old anchor in the TAG's "Writing Promise-Using Specifications" no longer exists, as the text was moved to the WebIDL specification to fix whatwg/webidl#490. Fixes ``` page was found but not the anchor from output.html to https://www.w3.org/2001/tag/doc/promises-guide#a-new-promise ``` * Fix the reference to DOM's AbortSignal's "added" definition: ``` ReSpec error: Couldn't match "**added**" to anything in the document or in any other document cited in this specification: `dom`, `feature-policy`, `fetch`, `html`, `infra`, `permissions`, `url`, `webidl`. ```
* Fix reference to "a new promise". The old anchor in the TAG's "Writing Promise-Using Specifications" no longer exists, as the text was moved to the WebIDL specification to fix whatwg/webidl#490. Fixes ``` page was found but not the anchor from output.html to https://www.w3.org/2001/tag/doc/promises-guide#a-new-promise ``` * Fix the reference to DOM's AbortSignal's "added" definition: ``` ReSpec error: Couldn't match "**added**" to anything in the document or in any other document cited in this specification: `dom`, `feature-policy`, `fetch`, `html`, `infra`, `permissions`, `url`, `webidl`. ```
Most of the algorithms in https://www.w3.org/2001/tag/doc/promises-guide for resolving and rejecting should be part of IDL (and formalized in the process). Resolving from "in parallel" should be something that HTML defines I think.
The text was updated successfully, but these errors were encountered: