diff options
author | Michał Gołębiowski <m.goleb@gmail.com> | 2015-08-02 01:48:54 +0200 |
---|---|---|
committer | Michał Gołębiowski <m.goleb@gmail.com> | 2015-08-03 18:55:36 +0200 |
commit | b988c0e45d0d876ae7d12e7b361a25a8ea76cf2f (patch) | |
tree | b7519b4dc42954be7f86e8103ff271fb5c09aee5 /Gruntfile.js | |
parent | b8b111e337e75010adf6bc610913f7e2084741bf (diff) | |
download | jquery-b988c0e45d0d876ae7d12e7b361a25a8ea76cf2f.tar.gz jquery-b988c0e45d0d876ae7d12e7b361a25a8ea76cf2f.zip |
Build: Add a comment explaining why the es3 option is needed
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.
(cherry-picked from 669cb16d763cb5486dadd56ec15a17b2b0303571)
Closes gh-2520
Diffstat (limited to 'Gruntfile.js')
-rw-r--r-- | Gruntfile.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Gruntfile.js b/Gruntfile.js index 4108a1f18..082bf28c8 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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 |