Skip to content

Commit

Permalink
module: revert "optimize js and json file i/o"
Browse files Browse the repository at this point in the history
This reverts commit 7c60328.

It is causing CI failures on Windows.

Ref: nodejs#4575
PR-URL: nodejs#4679
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
  • Loading branch information
Trott authored and Michael Scovetta committed Apr 2, 2016
1 parent d9ae28b commit bdec218
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,14 +428,14 @@ Module.prototype._compile = function(content, filename) {

// Native extension for .js
Module._extensions['.js'] = function(module, filename) {
var content = internalModuleReadFile(filename);
var content = fs.readFileSync(filename, 'utf8');
module._compile(internalModule.stripBOM(content), filename);
};


// Native extension for .json
Module._extensions['.json'] = function(module, filename) {
var content = internalModuleReadFile(filename);
var content = fs.readFileSync(filename, 'utf8');
try {
module.exports = JSON.parse(internalModule.stripBOM(content));
} catch (err) {
Expand Down

0 comments on commit bdec218

Please sign in to comment.