string.js 821 B

1234567891011121314151617181920212223242526
  1. /*!
  2. {
  3. "name": "ES6 String",
  4. "property": "es6string",
  5. "notes": [{
  6. "name": "unofficial ECMAScript 6 draft specification",
  7. "href": "https://web.archive.org/web/20180825202128/https://tc39.github.io/ecma262/"
  8. }],
  9. "polyfills": ["es6shim"],
  10. "authors": ["Ron Waldon (@jokeyrhyme)"],
  11. "warnings": ["ECMAScript 6 is still a only a draft, so this detect may not match the final specification or implementations."],
  12. "tags": ["es6"]
  13. }
  14. !*/
  15. /* DOC
  16. Check if browser implements ECMAScript 6 String per specification.
  17. */
  18. define(['Modernizr'], function(Modernizr) {
  19. Modernizr.addTest('es6string', !!(String.fromCodePoint &&
  20. String.raw &&
  21. String.prototype.codePointAt &&
  22. String.prototype.repeat &&
  23. String.prototype.startsWith &&
  24. String.prototype.endsWith &&
  25. String.prototype.includes));
  26. });