-
Notifications
You must be signed in to change notification settings - Fork 164
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
Can we have a way for enums to not throw if there are unknown values #491
Comments
As arguments to method calls, you mean? They don't throw in setters. How will you feature detect this? |
Yeah, and when in the manifest.json files. This is an issue for us for the manifest and will be so too for method calls. Method calls less so because that call will fail, but it is bad that one browser supports a new value in the manifest and when developers start adopting that feature, the whole manifest will fail is all browsers who didn't implement it yet. |
I don't see a simple solution offhand, here. I'm surprised this didn't come up earlier as an issue. |
@kenchris as I said in various places I don't think using IDL to constrain a manifest is a good idea. See whatwg/infra#159 for suggestions. I agree that ignoring in a manifest is better. Can you get folks to contribute there to figure out a common solution for constraining JSON manifests? |
There are other reasons to use the Web IDL, it simplifies processing and @mgiuca and @marcoscaceres want to reuse parts in other specs, like Share Target and Web Payments AFAIK. This is really the only problem we have currently, so if we could find a way to spec this difference for the processing that would solve a lot of issues for us right now. I am not opposed to use another solution if we can come up with one, but I do understand the need to reuse similar syntax/objects in other APIs. |
For the case of manifest.json files, wouldn't that be handled by whatever spec defines that processing? That's certainly not webidl itself at the moment.... For methods, note the discussion in https://www.w3.org/Bugs/Public/show_bug.cgi?id=19936 but apart from that, it's not clear what non-throwing behavior you might want for a method call with an unknown enum value, exactly. |
As far a Web Manifest is concerned, this can be closed. Web manifest no longer uses Web IDL. Let's keep any discussion around enum throwing in #893. |
Thanks @marcoscaceres for the update! |
The reason is that more values might be added in the future, so we wouldn't want existing implementation to throw in those cases, but instead ignore the value or do some kind of fallback.
The text was updated successfully, but these errors were encountered: