templatestrings.js 691 B

1234567891011121314151617181920212223242526
  1. /*!
  2. {
  3. "name": "Template strings",
  4. "property": "templatestrings",
  5. "notes": [{
  6. "name": "MDN Docs",
  7. "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Browser_compatibility"
  8. }]
  9. }
  10. !*/
  11. /* DOC
  12. Template strings are string literals allowing embedded expressions.
  13. */
  14. define(['Modernizr'], function(Modernizr) {
  15. Modernizr.addTest('templatestrings', function() {
  16. var supports;
  17. try {
  18. // A number of tools, including uglifyjs and require, break on a raw "`", so
  19. // use an eval to get around that.
  20. // eslint-disable-next-line
  21. eval('``');
  22. supports = true;
  23. } catch (e) {}
  24. return !!supports;
  25. });
  26. });