json.js 534 B

123456789101112131415161718192021
  1. /*!
  2. {
  3. "name": "JSON",
  4. "property": "json",
  5. "caniuse": "json",
  6. "notes": [{
  7. "name": "MDN Docs",
  8. "href": "https://developer.mozilla.org/en-US/docs/Glossary/JSON"
  9. }],
  10. "polyfills": ["json2"]
  11. }
  12. !*/
  13. /* DOC
  14. Detects native support for JSON handling functions.
  15. */
  16. define(['Modernizr'], function(Modernizr) {
  17. // this will also succeed if you've loaded the JSON2.js polyfill ahead of time
  18. // ... but that should be obvious. :)
  19. Modernizr.addTest('json', 'JSON' in window && 'parse' in JSON && 'stringify' in JSON);
  20. });