From f6b8d05d6343a04a522fe08f80466b2515a561b0 Mon Sep 17 00:00:00 2001 From: Chris Malley Date: Wed, 11 Feb 2015 16:49:51 -0700 Subject: [PATCH] #96 lint fixes for loadFileAsDataURI.js --- grunt/jshintOptions.js | 3 ++- requirejs-plugins/loadFileAsDataURI.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/grunt/jshintOptions.js b/grunt/jshintOptions.js index 06e6aaeeb..37c375863 100644 --- a/grunt/jshintOptions.js +++ b/grunt/jshintOptions.js @@ -76,7 +76,8 @@ module.exports = { alert: false, //for debugging on ipad numeric: false, //Numeric library used in energy skate park location: false, //For setting location.href to save to local file, see http://stackoverflow.com/questions/2897619/using-html5-javascript-to-generate-and-save-a-file - FileReader: false //For file loading, see SaveLoadNode in Energy Skate Park: Basics + FileReader: false, //For file loading, see SaveLoadNode in Energy Skate Park: Basics + Buffer: false } }; diff --git a/requirejs-plugins/loadFileAsDataURI.js b/requirejs-plugins/loadFileAsDataURI.js index b239a8e6b..64df47513 100644 --- a/requirejs-plugins/loadFileAsDataURI.js +++ b/requirejs-plugins/loadFileAsDataURI.js @@ -26,7 +26,7 @@ define( function() { throw new Error( 'Unknown mime type for filename: ' + filename ); } - var base64 = 'data:' + mimeType + ';base64,' + Buffer( fs.readFileSync( filename ) ).toString( 'base64' ); + var base64 = 'data:' + mimeType + ';base64,' + new Buffer( global.fs.readFileSync( filename ) ).toString( 'base64' ); return base64; }; } ); \ No newline at end of file