On Wed, Mar 25, 2015 at 1:17 PM, James Kyle <m...@thejameskyle.com> wrote: > The reason `@supports` works in CSS is because of the limited language > feature-set CSS has, but this wouldn't work in JavaScript.
No, it works because most of the time, whether or not something parses is a sufficient proxy for "this is supported". This isn't always adequate - for example, you can't test whether a browser supports APNG in CSS properties with this - but that's okay. Similarly, a JS version would let you test for anything where parsing is a proxy for support, like "function*(){...}" or "()=>{}". It wouldn't help you with things where parsing is successful whether the feature is supported or not. There's no good way to support those cases that parsing doesn't address besides direct feature tests, or support tables. Luckily, both of these already exist in the ecosystem, so it's okay that we're not solving them. ~TJ _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss