Modernizr/Modernizr — pull request #1289 by jokeyrhyme (2014-03-29 21:33:08+00:00)
Title: detects for complete ES5 support, inc. syntax and read-only undefined

This PR adds the `es5` detect to aggregate all other ES5 tests, so that downstream consumers do not need to do so.

In order to complete the detection of ECMAScript 5, it also adds:
- `es5syntax`: getters/setters in Object literals, Array-like index access on Strings, allowed use of reserved keywords as Object property keys, and allowed use of zero-width unicode characters as variable names
- `es5undefined`: a detect for immutable `undefined`

I always try to minimise modifications to existing code / detects. As part of this work, however, I felt it was necessary to add a check for `JSON.stringify` to the `json` detect.

Further, there are some problems with these detects that need to be discussed:
- to get `es5undefined` to work, I had to remove the `undefined` argument from Modernizr's outer-most immediate function
- I know this is done in jQuery's source code too
- could the `es5undefined` detect be performed during Modernizr initialisation, before using the argument trick?
- `es5syntax` has to use `eval()` in order to work, which means that there will likely be issues with sites that enable certain CSP features
- I already added a `warning` field to the metadata
- is there a better way to detect JavaScript syntax support?