-
-
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
Monkey patch partial interface definitions #84
Comments
Can you work around this by adding all the necessary dependent idl interfaces and throwing away the output of the unnecessary files? |
Oh, if you're monkey patching anyways, do you even need the partial Navigator idl at all? |
It seems to me that between this and #81 there's room for a "assume existing globals" mode (or "polyfill mode") which makes this sort of thing seamlessly work. |
An polyfill mode would be great!
For my use case, I'm using webidl2js to generate JavaScript polyfills for
use in a browser. Adding necessary dependent IDL interfaces and throwing
away the output can work, but would be tricky to automate into the build
process.
The partial Navigator IDL is convenient so I can use the same IDL source
for both interface generating using webidl2js and running Web Platform Test
idlharness test to cover the entire interface definition.
|
stevedorries
pushed a commit
to stevedorries/webidl2js
that referenced
this issue
Jan 27, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When a spec defines a partial addition to an existing interface, it will be useful if webidl2js can generate the monkey patch required to implement the addition.
For example, from the Credential Management Level 1 spec:
Currently webild2js assumes that
Navigator
is defined somewhere else in the provided webidl and errors out in parsing as it's not found:What we need is probably something like this:
We might need to also account for the fact that
CredentialsContainer
may be provided natively by the UA, so may not have theinterface
attribute (see #81).The text was updated successfully, but these errors were encountered: