array.js 810 B

12345678910111213141516171819202122232425262728293031
  1. /*!
  2. {
  3. "name": "ES5 Array",
  4. "property": "es5array",
  5. "notes": [{
  6. "name": "ECMAScript 5.1 Language Specification",
  7. "href": "https://www.ecma-international.org/ecma-262/5.1/"
  8. }],
  9. "polyfills": ["es5shim"],
  10. "authors": ["Ron Waldon (@jokeyrhyme)"],
  11. "tags": ["es5"]
  12. }
  13. !*/
  14. /* DOC
  15. Check if browser implements ECMAScript 5 Array per specification.
  16. */
  17. define(['Modernizr'], function(Modernizr) {
  18. Modernizr.addTest('es5array', function() {
  19. return !!(Array.prototype &&
  20. Array.prototype.every &&
  21. Array.prototype.filter &&
  22. Array.prototype.forEach &&
  23. Array.prototype.indexOf &&
  24. Array.prototype.lastIndexOf &&
  25. Array.prototype.map &&
  26. Array.prototype.some &&
  27. Array.prototype.reduce &&
  28. Array.prototype.reduceRight &&
  29. Array.isArray);
  30. });
  31. });