From 6ab5b2993bd68379fa259d75f147435d3220ba4c Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Wed, 10 Dec 2014 17:01:21 -0500 Subject: [PATCH] Removing references to "self" --- src/js/parser/javascript/match.js | 8 +++----- src/js/parser/javascript/regexp.js | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/js/parser/javascript/match.js b/src/js/parser/javascript/match.js index 651e4d5..ca3ba0f 100644 --- a/src/js/parser/javascript/match.js +++ b/src/js/parser/javascript/match.js @@ -5,8 +5,6 @@ export default _.extend({}, Base, { type: 'match', render() { - var self = this; - this.contents = {}; if (this.anchorStart()) { @@ -14,11 +12,11 @@ export default _.extend({}, Base, { .addClass('anchor'); } - this.contents.parts = _.map(this.parts(), function(part) { - part.setContainer(self.container.group()); + this.contents.parts = _.map(this.parts(), (function(part) { + part.setContainer(this.container.group()); part.render(); return part; - }); + }).bind(this)); if (this.anchorEnd()) { this.contents.anchor_end = this.renderLabel(this.container, 'End of line') diff --git a/src/js/parser/javascript/regexp.js b/src/js/parser/javascript/regexp.js index c506e21..b340c57 100644 --- a/src/js/parser/javascript/regexp.js +++ b/src/js/parser/javascript/regexp.js @@ -5,15 +5,13 @@ export default _.extend({}, Base, { type: 'regexp', render() { - var self = this; - this.matchContainer = this.container.group(); - _.each(this.matches(), match => { - match.setContainer(self.matchContainer.group()); + _.each(this.matches(), (match => { + match.setContainer(this.matchContainer.group()); match.render(); return match.container; - }); + }).bind(this)); }, position() {