From 4b8ae42c1497ffb1fd58b599ced0c53f741099a9 Mon Sep 17 00:00:00 2001 From: Arzhan Kinzhalin Date: Mon, 15 Jul 2013 18:44:55 -0300 Subject: [PATCH] Fix code review issues. --- src/file/FileUtils.js | 20 +++++++++----------- src/language/LanguageManager.js | 6 +++--- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/file/FileUtils.js b/src/file/FileUtils.js index 3cfa86b5ef3..15db2018206 100644 --- a/src/file/FileUtils.js +++ b/src/file/FileUtils.js @@ -332,7 +332,7 @@ define(function (require, exports, module) { /** * Determine if file extension is a static html file extension. - * @param {string} file name with extension or just a file extension + * @param {string} fileExt file name with extension or just a file extension * @return {boolean} Returns true if fileExt is in the list */ function isStaticHtmlFileExt(fileExt) { @@ -345,7 +345,7 @@ define(function (require, exports, module) { /** * Determine if file extension is a server html file extension. - * @param {string} file name with extension or just a file extension + * @param {string} fileExt file name with extension or just a file extension * @return {boolean} Returns true if fileExt is in the list */ function isServerHtmlFileExt(fileExt) { @@ -358,7 +358,7 @@ define(function (require, exports, module) { /** * Get the parent directory of a file. If a directory is passed in the directory is returned. - * @param {string} full path to a file or directory + * @param {string} fullPath full path to a file or directory * @return {string} Returns the path to the parent directory of a file or the path of a directory */ function getDirectoryPath(fullPath) { @@ -367,7 +367,7 @@ define(function (require, exports, module) { /** * Get the base name of a file or a directory. - * @param {string} full path to a file or directory + * @param {string} fullPath full path to a file or directory * @return {string} Returns the base name of a file or the name of a * directory */ @@ -379,21 +379,19 @@ define(function (require, exports, module) { /** * Get the filename extension. * - * @param {string} full path to a file or directory + * @param {string} fullPath full path to a file or directory * @return {string} Returns the extension of a filename or empty string if - * the argument is a directory + * the argument is a directory or a filename with no extension */ function getFilenameExtension(fullPath) { var baseName = getBaseName(fullPath), - idx; - - idx = baseName.lastIndexOf("."); + idx = baseName.lastIndexOf("."); if (idx === -1) { return ""; - } else { - return baseName.substr(idx); } + + return baseName.substr(idx); } diff --git a/src/language/LanguageManager.js b/src/language/LanguageManager.js index 67635a96fd1..174d916a35e 100644 --- a/src/language/LanguageManager.js +++ b/src/language/LanguageManager.js @@ -103,8 +103,8 @@ define(function (require, exports, module) { // Dependencies var Async = require("utils/Async"), - _defaultLanguagesJSON = require("text!language/languages.json"), - FileUtils = require("file/FileUtils"); + FileUtils = require("file/FileUtils"), + _defaultLanguagesJSON = require("text!language/languages.json"); // State @@ -189,7 +189,7 @@ define(function (require, exports, module) { */ function getLanguageForPath(path) { var fileName = FileUtils.getBaseName(path).toLowerCase(), - language = _fileNameToLanguageMap[fileName], + language = _fileNameToLanguageMap[fileName], extension, parts;