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

Yeah, if this is going to be specifically about feature-detecting whether an impl. supports a dictionary key, then I don't see why we would want to tie it to a particular method.

In addition to the multiple-dicts-per-method problem, you could also imagine two methods taking the same dictionary:

```webidl
dictionary MyDict {
  int mykey;
}

partial interface Navigator {
  void method1(MyDict options);
  void method2(MyDict options);
}
```

Then the developer has to decide which method to enquire about (even though they both return the same answer), and possibly get confused about whether they need to perform the enquiry twice:

```js
if (method1.supports('mykey')) {
  method1({mykey: ...});
}
if (method2.supports('mykey')) {
  // Is the above check redundant? Can I just combine this into a single if statement?
  method2({mykey: ...});
}
```

Probably best to just allow feature detection on the dict itself, not the method.

-- 
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-304169479

Received on Friday, 26 May 2017 01:49:26 UTC