Supporting feature tests directly

Jordan Harband ljharb at gmail.com
Sun Mar 22 00:40:01 UTC 2015


In http://npmjs.com/make-generator-function,
https://www.npmjs.com/package/make-arrow-function, and the tests for
https://github.com/es-shims/RegExp.prototype.flags/blob/master/test/index.js#L6-L12,
I use `Function` eval to test for support of these things - one could do
the same with `let`, `const`, etc.

I'd be very interested to hear about any non-eval solution for this.

On Sat, Mar 21, 2015 at 5:10 PM, Axel Rauschmayer <axel at rauschma.de> wrote:

> I don’t think there are even documented best practices for ES6, yet
> (w.r.t. switching between native ES6 and transpiled ES6). That’d be
> interesting, too.
>
> On 21 Mar 2015, at 21:28, Kyle Simpson <getify at gmail.com> wrote:
>
> Has there been any consideration or discussion for direct support of
> feature tests for ES7+ features/syntax? I'm thinking specifically of things
> which are difficult or impossible to just simply test for, like via the
> existence of some identifier.
>
> I have an idea of what that could look like, and am happy to discuss
> further here if appropriate. But I was just checking to see if there's any
> prior art around related specifically to JS to consider before I do?
>
>
> --
> Dr. Axel Rauschmayer
> axel at rauschma.de
> rauschma.de
>
>
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150321/318651a0/attachment.html>


More information about the es-discuss mailing list