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 <a...@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 <get...@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 > a...@rauschma.de > rauschma.de > > > > > _______________________________________________ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > >
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss