Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Fix code review issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
busykai committed Jul 15, 2013
1 parent ae48141 commit 4b8ae42
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
20 changes: 9 additions & 11 deletions src/file/FileUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand All @@ -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
*/
Expand All @@ -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);
}


Expand Down
6 changes: 3 additions & 3 deletions src/language/LanguageManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 4b8ae42

Please sign in to comment.