Merge pull request #588 from hexid/refactor-bc
Refactor to remove unnecessary entries in paths array
Showing
1 changed file
with
1 additions
and
1 deletions
... | @@ -189,9 +189,9 @@ CasperError.prototype = Object.getPrototypeOf(new Error()); | ... | @@ -189,9 +189,9 @@ CasperError.prototype = Object.getPrototypeOf(new Error()); |
189 | var extensions = ['js', 'coffee', 'json']; | 189 | var extensions = ['js', 'coffee', 'json']; |
190 | var basenames = [path, path + '/index']; | 190 | var basenames = [path, path + '/index']; |
191 | var paths = []; | 191 | var paths = []; |
192 | extensions.forEach(function(extension) { | ||
193 | basenames.forEach(function(basename) { | 192 | basenames.forEach(function(basename) { |
194 | paths.push(fs.pathJoin(dir, basename)); | 193 | paths.push(fs.pathJoin(dir, basename)); |
194 | extensions.forEach(function(extension) { | ||
195 | paths.push(fs.pathJoin(dir, [basename, extension].join('.'))); | 195 | paths.push(fs.pathJoin(dir, [basename, extension].join('.'))); |
196 | }); | 196 | }); |
197 | }); | 197 | }); | ... | ... |
-
Please register or sign in to post a comment