Re: [heycam/webidl] Need pattern for feature detecting dictionary members (#107)

I like the supports() proposal. Here is another idea I would just like to throw into the ring...

The fact that unsupported dictionary members are silently ignored is generally nice for compatibility... Until we encounter an option that the web app can't live without.  Basically, there are options that fall into the 'like to have' category and others that are required by the web app.  Right now, everything is treated as like-to-have.  What if we added some form of notation to indicate options that are strictly required. I'm not sure how exactly we'd do this. Here's a straw man proposal: what if a '+' prefix in front of a dictionary key indicated a required option.
Then we could do something like this:

```
createImageBimap(myBlob, { +imageOrientation: "flipY", colorSpaceConversion: "none" }).then(onLoad, callFlipYPolyfill);
```

Basically, the call would be forced to fail (in this case reject the promise) when a required option is not supported. Obviously, there would have to be a way to feature detect the special notation.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/107#issuecomment-304083155

Received on Thursday, 25 May 2017 18:16:57 UTC