From 369f2d4b76740bcdc7f14291b4621f79c7fa1ee8 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 28 Oct 2014 12:08:09 -0700 Subject: mv var to top of function to be consistent with style in rest of file --- lib/rewire.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/rewire.js b/lib/rewire.js index 5644599..167d7b3 100644 --- a/lib/rewire.js +++ b/lib/rewire.js @@ -19,7 +19,8 @@ var srcs = { function internalRewire(parentModulePath, targetPath) { var targetModule, prelude, - appendix; + appendix, + src; // Checking params if (typeof targetPath !== "string") { @@ -56,7 +57,7 @@ function internalRewire(parentModulePath, targetPath) { // Check if the module uses the strict mode. // If so we must ensure that "use strict"; stays at the beginning of the module. - var src = fs.readFileSync(targetPath, "utf8"); + src = fs.readFileSync(targetPath, "utf8"); if (detectStrictMode(src) === true) { prelude = ' "use strict"; ' + prelude; } -- cgit v1.2.3