]> source.dussan.org Git - jquery.git/commitdiff
Build: Add a comment explaining why the es3 option is needed
authorMichał Gołębiowski <m.goleb@gmail.com>
Sat, 1 Aug 2015 23:48:54 +0000 (01:48 +0200)
committerMichał Gołębiowski <m.goleb@gmail.com>
Mon, 3 Aug 2015 16:51:18 +0000 (18:51 +0200)
It might not be obvious to everyone that IE 9 & Android 4.0 are not
ES5-compliant browsers (by a large margin) so it's better to add a support
comment. This requires slight changes in parsing the config file
as it's not a pure JSON anymore. JSHint understands such files without
problems.

Closes gh-2520

Gruntfile.js
package.json
src/.jshintrc

index 1a6bdac1ac413858a6abea654212a172f867004a..0fe64d7e6f425e1b69296776030d9f66f4f7ee67 100644 (file)
@@ -4,12 +4,16 @@ module.exports = function( grunt ) {
        function readOptionalJSON( filepath ) {
                var data = {};
                try {
-                       data = grunt.file.readJSON( filepath );
+                       data = JSON.parse( stripJSONComments(
+                               fs.readFileSync( filepath, { encoding: "utf8" } )
+                       ) );
                } catch ( e ) {}
                return data;
        }
 
-       var gzip = require( "gzip-js" ),
+       var fs = require( "fs" ),
+               stripJSONComments = require( "strip-json-comments" ),
+               gzip = require( "gzip-js" ),
                srcHintOptions = readOptionalJSON( "src/.jshintrc" );
 
        // The concatenated file won't pass onevar
index 5d82995343ce76ee3a4da0b5de385bcafa4af7eb..43d24ba5d4429e8c5327896bff96c72209fd6ae6 100644 (file)
@@ -47,6 +47,7 @@
     "requirejs": "2.1.17",
     "sinon": "1.10.3",
     "sizzle": "2.2.0",
+    "strip-json-comments": "1.0.3",
     "testswarm": "1.1.0",
     "win-spawn": "2.0.0"
   },
index 281b683b90270b309680472e8b708d52a655ac8b..ea3549d5c6dd350e05b4a29cc0470e93b9a0d41a 100644 (file)
@@ -12,6 +12,9 @@
 
        "sub": true,
 
+       // Support: IE < 10, Android < 4.1
+       // The above browsers are failing a lot of tests in the ES5
+       // test suite at http://test262.ecmascript.org.
        "es3": true,
 
        "globals": {