-
-
Notifications
You must be signed in to change notification settings - Fork 30
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-returning operations should return Promise.reject on invalid argument #79
Comments
FYI https://help.github.com/articles/creating-and-highlighting-code-blocks/ for putting code in GitHub. I'll edit your post to do that :) |
Thanks! Will do next time. |
Web IDL reference: https://heycam.github.io/webidl/#dfn-create-operation-function step 2:
Likewise we should fix this for attribute getters and setters, which has a similar clause. |
This is blocking the Streams Standard reference implementation from migrating to webidl2js. If anyone is excited about taking this I would very much appreciate it. Otherwise I'll try to find time soon! |
We could probably implement this rather easily by just marking the functions async if they have a Promise return type nowadays since our node requirements are high enough, yeah? |
True, I think that would probably do it! |
Passes most tests except blocked on jsdom/webidl2js#123 (comment) and jsdom/webidl2js#79
Closes #79. This removes support for overloading promise operations and non-promise operations, since that would require a more ambitious approach and doesn't seem to appear on the web.
The thing is, WebIDL creates a rejected Promise synchronously in that case, whereas This is also why #172 and #194 use |
Closes #79. This removes support for overloading promise operations and non-promise operations, since that would require a more ambitious approach and doesn't seem to appear on the web.
Closes #79. This removes support for overloading promise operations and non-promise operations, since that would require a more ambitious approach and doesn't seem to appear on the web.
Closes #79. This removes support for overloading promise operations and non-promise operations, since that would require a more ambitious approach and doesn't seem to appear on the web.
Closes #79. This removes support for overloading promise operations and non-promise operations, per whatwg/webidl#776.
If an interface defines a Promise-returning operation with required arguments, the generated wrapper throws TypeError if insufficient number of arguments are provided. I believe the expected behavior is to return a Promise.reject that throws.
E.g.
Generates:
[*] should be:
I couldn't find exact wording in WebIDL spec about this. However, the return-rejected-promise behavior is what Web Platform Test's idlharness.js enforces.
The text was updated successfully, but these errors were encountered: