Skip to content

Commit

Permalink
Remove straggling trailing commas in objects
Browse files Browse the repository at this point in the history
* This is considered bad form and could eventually break this controller if V8 updates to strict mode.
* Think I got all of them on a manual survey of this controller.

Applies to OpenUserJS#200 and should be clarified in OpenUserJS#19
  • Loading branch information
Martii committed Jun 25, 2014
1 parent f02fb78 commit f587ab4
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions controllers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ var setupUserSidePanel = function (options) {
return {
id: index,
name: roleName,
selected: index === user.role,
selected: index === user.role
};
});

Expand Down Expand Up @@ -312,7 +312,7 @@ exports.userCommentListPage = function (req, res, next) {
// commentListQuery: Populate: discussion
commentListQuery.populate({
path: '_discussionId',
model: 'Discussion',
model: 'Discussion'
});

// SearchBar
Expand Down Expand Up @@ -799,7 +799,7 @@ exports.userGitHubRepoListPage = function (req, res, next) {
function (githubUser, callback) {
options.githubUser = githubUser;
options.userGitHubRepoListPageUrl = helpers.updateUrlQueryString(authedUser.userGitHubRepoListPageUrl, {
user: githubUser.login,
user: githubUser.login
});

// Pagination
Expand All @@ -813,7 +813,7 @@ exports.userGitHubRepoListPage = function (req, res, next) {
github.repos.getFromUser({
user: encodeURIComponent(githubUserId),
page: pagination.currentPage,
per_page: pagination.itemsPerPage,
per_page: pagination.itemsPerPage
}, callback);
},
// function (githubRepoList, callback) {
Expand All @@ -825,7 +825,7 @@ exports.userGitHubRepoListPage = function (req, res, next) {
var url = authedUser.userGitHubRepoPageUrl;
url = helpers.updateUrlQueryString(url, {
user: options.githubUser.login,
repo: githubRepo.name,
repo: githubRepo.name
});
githubRepo.userGitHubRepoPageUrl = url;
});
Expand All @@ -842,7 +842,7 @@ exports.userGitHubRepoListPage = function (req, res, next) {
console.error(err);
return statusCodePage(req, res, next, {
statusCode: 500,
statusMessage: 'Server Error',
statusMessage: 'Server Error'
});
}

Expand Down Expand Up @@ -874,7 +874,7 @@ exports.userGitHubImportScriptPage = function (req, res, next) {
if (!(githubUserId && githubRepoName && githubBlobPath)) {
return statusCodePage(req, res, next, {
statusCode: 400,
statusMessage: 'Bad Request. Require <code>user</code>, <code>repo</code>, and <code>path</code> to be set.',
statusMessage: 'Bad Request. Require <code>user</code>, <code>repo</code>, and <code>path</code> to be set.'
});
}

Expand All @@ -884,7 +884,7 @@ exports.userGitHubImportScriptPage = function (req, res, next) {
function (callback) {
github.gitdata.getJavascriptBlobs({
user: encodeURIComponent(githubUserId),
repo: encodeURIComponent(githubRepoName),
repo: encodeURIComponent(githubRepoName)
}, callback);
},
function (javascriptBlobs, callback) {
Expand All @@ -904,7 +904,7 @@ exports.userGitHubImportScriptPage = function (req, res, next) {
github.usercontent.getBlobAsUtf8({
user: encodeURIComponent(githubUserId),
repo: encodeURIComponent(githubRepoName),
path: encodeURIComponent(githubBlobPath),
path: encodeURIComponent(githubBlobPath)
}, callback);
},
function (blobUtf8, callback) {
Expand Down Expand Up @@ -945,7 +945,7 @@ exports.userGitHubImportScriptPage = function (req, res, next) {
console.error(githubUserId, githubRepoName, githubBlobPath);
return statusCodePage(req, res, next, {
statusCode: 400,
statusMessage: err,
statusMessage: err
});
}

Expand Down Expand Up @@ -975,7 +975,7 @@ exports.userGitHubRepoPage = function (req, res, next) {
if (!(githubUserId && githubRepoName)) {
return statusCodePage(req, res, next, {
statusCode: 400,
statusMessage: 'Bad Request. Require <code>?user=githubUserName&repo=githubRepoName</code>',
statusMessage: 'Bad Request. Require <code>?user=githubUserName&repo=githubRepoName</code>'
});
}

Expand All @@ -984,7 +984,7 @@ exports.userGitHubRepoPage = function (req, res, next) {
});
options.userGitHubRepoPageUrl = helpers.updateUrlQueryString(authedUser.userGitHubRepoPageUrl, {
user: githubUserId,
repo: githubRepoName,
repo: githubRepoName
});

// Metadata
Expand All @@ -999,15 +999,15 @@ exports.userGitHubRepoPage = function (req, res, next) {
function (callback) {
github.repos.get({
user: encodeURIComponent(githubUserId),
repo: encodeURIComponent(githubRepoName),
repo: encodeURIComponent(githubRepoName)
}, callback);
},
function (repo, callback) {
options.repo = repo;

github.gitdata.getJavascriptBlobs({
user: encodeURIComponent(repo.owner.login),
repo: encodeURIComponent(repo.name),
repo: encodeURIComponent(repo.name)
}, callback);
},
function (javascriptBlobs, callback) {
Expand All @@ -1017,7 +1017,7 @@ exports.userGitHubRepoPage = function (req, res, next) {
javascriptBlob.userGitHubImportPageUrl = helpers.updateUrlQueryString(authedUser.userGitHubImportPageUrl, {
user: githubUserId,
repo: githubRepoName,
path: javascriptBlob.path,
path: javascriptBlob.path
});
});
_.each(javascriptBlobs, parseJavascriptBlob);
Expand Down Expand Up @@ -1049,7 +1049,7 @@ var parseJavascriptBlob = function (javascriptBlob) {
dir: m[1],
name: m[2],
ext: m[3],
filename: m[2] + m[3],
filename: m[2] + m[3]
};

// Errors
Expand Down Expand Up @@ -1103,14 +1103,14 @@ exports.userManageGitHubPage = function (req, res, next) {
function (callback) {
var githubUserId = authedUser.githubUserId();
github.user.getFrom({
user: encodeURIComponent(githubUserId),
user: encodeURIComponent(githubUserId)
}, callback);
},
function (githubUser, callback) {
options.githubUser = githubUser;
console.log(githubUser);
User.findOne({
_id: authedUser._id,
_id: authedUser._id
}, callback);
},
function (userData, callback) {
Expand Down Expand Up @@ -1185,7 +1185,7 @@ exports.userManageGitHubPage = function (req, res, next) {
async.parallel(tasks, function (err) {
if (err) {
return statusCodePage(req, res, next, {
statusMessage: err,
statusMessage: err
})
}

Expand Down

0 comments on commit f587ab4

Please sign in to comment.