Supporting feature tests directly

Kos Ddsky kosich at gmail.com
Wed Mar 25 21:48:23 UTC 2015


>
>  It's not that it's imperfect. It's that it's useless in the real world.

...

> What's the alternative? To send down a file that tests for support and
> then sends it back to the server and then build the appropriate assets for
> that browser?


Its possible in the AMD approach. Idk though if its useful.

The need in TCO detection is really debatable, but one might be using it,
say, in two years from now to throw a _proper_ exception while running some
crazy recursive code in an old browser.

NB: it would be practical only if feature detection possibility lands to a
browser with (or even before) corresponding feature. And, imho, that's what
Kyle Simpson meant, starting the thread: handy feature detection available
_prior_ to feature implementation.

Two more off-topic cents:
If at any point we will

   - have adjustable features, like disabling at some scope `eval`, `with`,
   `Function()` or using `global object`
   - or a new `stricter mode`
   - or choosing new Number representation
   - ... or whatever

it would be nice to be able to detect such state, without `try..catch` in a
fast & semantic way.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150325/164300c1/attachment-0001.html>


More information about the es-discuss mailing list