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 diff --git a/package.json b/package.json index 521cbe1ec..eb6c27f49 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "requirejs": "2.1.17", "sinon": "1.12.2", "sizzle": "2.2.0", + "strip-json-comments": "1.0.3", "testswarm": "1.1.0" }, "scripts": { diff --git a/src/.jshintrc b/src/.jshintrc index d0445ba77..87dcde1cd 100644 --- a/src/.jshintrc +++ b/src/.jshintrc @@ -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, "browser": true, "wsh": true,