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

Many new APIs (and some new arguments to existing APIs) are relying in dictionaries.  But doing feature detection of such members requires ugly and complex code like:

```javascript
var supportsCaptureOption = false;
try {
  addEventListener("test", null, Object.defineProperty({}, 'capture', {get: function () {
    supportsCaptureOption = true;
  }}));
} catch(e) {}
```

This increases [the concern](https://github.com/WICG/EventListenerOptions/issues/12) that new APIs will lead to sites being broken on older browsers because developers didn't understand or couldn't be bothered with the difficult feature detection.

In WICG/EventListenerOptions#31 @tabatkins proposed a mechanism whereby all dictionary types would automatically get a JS-exposed object with a property-per-member to enable consistent and easy feature detection.

Thoughts? 

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

Received on Friday, 8 April 2016 21:50:34 UTC