diff --git a/src/js/git/commands.js b/src/js/git/commands.js index 949f47ae..0b8528eb 100644 --- a/src/js/git/commands.js +++ b/src/js/git/commands.js @@ -190,7 +190,7 @@ var commandConfig = { var set = Graph.getUpstreamSet(engine, 'HEAD'); // first resolve all the refs (as an error check) - var toCherrypick = _.map(generalArgs, function(arg) { + var toCherrypick = generalArgs.map(function (arg) { var commit = engine.getCommitFromRef(arg); // and check that its not upstream if (set[commit.get('id')]) { diff --git a/src/js/git/index.js b/src/js/git/index.js index e38fe572..b6874e8f 100644 --- a/src/js/git/index.js +++ b/src/js/git/index.js @@ -857,7 +857,7 @@ GitEngine.prototype.makeCommit = function(parents, id, options) { GitEngine.prototype.revert = function(whichCommits) { // resolve the commits we will rebase - var toRevert = _.map(whichCommits, function(stringRef) { + var toRevert = whichCommits.map(function(stringRef) { return this.getCommitFromRef(stringRef); }, this); @@ -1138,7 +1138,7 @@ GitEngine.prototype.push = function(options) { var makeCommit = function(id, parentIDs) { // need to get the parents first. since we order by depth, we know // the dependencies are there already - var parents = _.map(parentIDs, function(parentID) { + var parents = parentIDs.map(function(parentID) { return this.origin.refs[parentID]; }, this); return this.origin.makeCommit(parents, id); @@ -1246,7 +1246,7 @@ GitEngine.prototype.fetch = function(options) { } // get all remote branches and specify the dest / source pairs var allBranchesOnRemote = this.origin.branchCollection.toArray(); - var sourceDestPairs = _.map(allBranchesOnRemote, function(branch) { + var sourceDestPairs = allBranchesOnRemote.map(function(branch) { var branchName = branch.get('id'); didMakeBranch = didMakeBranch || this.makeRemoteBranchIfNeeded(branchName); @@ -1312,7 +1312,7 @@ GitEngine.prototype.fetchCore = function(sourceDestPairs, options) { var makeCommit = function(id, parentIDs) { // need to get the parents first. since we order by depth, we know // the dependencies are there already - var parents = _.map(parentIDs, function(parentID) { + var parents = parentIDs.map(function(parentID) { return this.refs[parentID]; }, this); return this.makeCommit(parents, id); @@ -1738,7 +1738,7 @@ GitEngine.prototype.updateBranchesFromSet = function(commitSet) { }); }, this); - var branchList = _.map(branchesToUpdate, function(val, id) { + var branchList = branchesToUpdate.map(function(val, id) { return id; }); return this.updateBranchesForHg(branchList); @@ -2340,7 +2340,7 @@ GitEngine.prototype.filterRebaseCommits = function( GitEngine.prototype.getRebasePreserveMergesParents = function(oldCommit) { var oldParents = oldCommit.get('parents'); - return _.map(oldParents, function(parent) { + return oldParents.map(function(parent) { var oldID = parent.get('id'); var newID = this.getMostRecentBumpedID(oldID); return this.refs[newID]; diff --git a/src/js/models/commandModel.js b/src/js/models/commandModel.js index a8264ba6..f8932e10 100644 --- a/src/js/models/commandModel.js +++ b/src/js/models/commandModel.js @@ -78,7 +78,7 @@ var Command = Backbone.Model.extend({ var generalArgs = this.getGeneralArgs(); var options = this.getOptionsMap(); - generalArgs = _.map(generalArgs, function(arg) { + generalArgs = generalArgs.map(function(arg) { return this.replaceDotWithHead(arg); }, this); var newMap = {}; diff --git a/src/js/views/gitDemonstrationView.js b/src/js/views/gitDemonstrationView.js index e769bd78..96460200 100644 --- a/src/js/views/gitDemonstrationView.js +++ b/src/js/views/gitDemonstrationView.js @@ -83,8 +83,8 @@ var GitDemonstrationView = ContainedBase.extend({ }, checkScroll: function() { - var children = this.$('div.demonstrationText').children(); - var heights = _.map(children, function(child) { return child.clientHeight; }); + var children = this.$('div.demonstrationText').children().toArray(); + var heights = children.map(function(child) { return child.clientHeight; }); var totalHeight = _.reduce(heights, function(a, b) { return a + b; }); if (totalHeight < this.$('div.demonstrationText').height()) { this.$('div.demonstrationText').addClass('noLongText'); diff --git a/src/js/views/levelDropdownView.js b/src/js/views/levelDropdownView.js index 31c29024..74fd809f 100644 --- a/src/js/views/levelDropdownView.js +++ b/src/js/views/levelDropdownView.js @@ -211,7 +211,7 @@ var LevelDropdownView = ContainedBase.extend({ }, getTabIndex: function() { - var ids = _.map(this.JSON.tabs, function(tab) { + var ids = this.JSON.tabs.map(function(tab) { return tab.id; }); return ids.indexOf(this.JSON.selectedTab);