hunting unnecessary selves (!)
Showing
2 changed files
with
6 additions
and
8 deletions
... | @@ -376,11 +376,9 @@ Casper.prototype.each = function each(array, fn) { | ... | @@ -376,11 +376,9 @@ Casper.prototype.each = function each(array, fn) { |
376 | this.log("each() only works with arrays", "error"); | 376 | this.log("each() only works with arrays", "error"); |
377 | return this; | 377 | return this; |
378 | } | 378 | } |
379 | (function _each(self) { | 379 | array.forEach.call(this, function _forEach(item, i) { |
380 | array.forEach(function _forEach(item, i) { | 380 | fn.call(this, this, item, i); |
381 | fn.call(self, self, item, i); | 381 | }); |
382 | }); | ||
383 | })(this); | ||
384 | return this; | 382 | return this; |
385 | }; | 383 | }; |
386 | 384 | ||
... | @@ -922,8 +920,8 @@ Casper.prototype.start = function start(location, then) { | ... | @@ -922,8 +920,8 @@ Casper.prototype.start = function start(location, then) { |
922 | }, this.options.timeout, this); | 920 | }, this.options.timeout, this); |
923 | } | 921 | } |
924 | if (utils.isString(location) && location.length > 0) { | 922 | if (utils.isString(location) && location.length > 0) { |
925 | return this.thenOpen(location, utils.isFunction(then) ? then : this.createStep(function _step(self) { | 923 | return this.thenOpen(location, utils.isFunction(then) ? then : this.createStep(function _step() { |
926 | self.log("start page is loaded", "debug"); | 924 | this.log("start page is loaded", "debug"); |
927 | })); | 925 | })); |
928 | } | 926 | } |
929 | return this; | 927 | return this; | ... | ... |
-
Please register or sign in to post a comment