From 19f700859b55b96c7ed9bdeb68482c6a9d84e1b2 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 13 Jan 2016 11:22:03 -0800 Subject: [PATCH] module: revert "optimize js and json file i/o" This reverts commit 7c603280024de60329d5da283fb8433420bc6716. It is causing CI failures on Windows. Ref: https://github.com/nodejs/node/pull/4575 PR-URL: https://github.com/nodejs/node/pull/4679 Reviewed-By: Colin Ihrig Reviewed-By: Ben Noordhuis --- lib/module.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/module.js b/lib/module.js index ca2c805bb0da16..a068bffa7d9056 100644 --- a/lib/module.js +++ b/lib/module.js @@ -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) {