fixed Casper.click default value casting of the 'fallbackToHref' arg
Showing
1 changed file
with
2 additions
and
2 deletions
... | @@ -202,7 +202,7 @@ | ... | @@ -202,7 +202,7 @@ |
202 | * @return Boolean | 202 | * @return Boolean |
203 | */ | 203 | */ |
204 | click: function(selector, fallbackToHref) { | 204 | click: function(selector, fallbackToHref) { |
205 | fallbackToHref = typeof(fallbackToHref) == "undefined" ? true : false; | 205 | fallbackToHref = typeof(fallbackToHref) == "undefined" ? true : !!fallbackToHref; |
206 | this.log("click on selector: " + selector, "debug"); | 206 | this.log("click on selector: " + selector, "debug"); |
207 | return this.evaluate(function() { | 207 | return this.evaluate(function() { |
208 | return __utils__.click(__casper_params__.selector, __casper_params__.fallbackToHref); | 208 | return __utils__.click(__casper_params__.selector, __casper_params__.fallbackToHref); |
... | @@ -778,7 +778,7 @@ | ... | @@ -778,7 +778,7 @@ |
778 | * @return Boolean | 778 | * @return Boolean |
779 | */ | 779 | */ |
780 | this.click = function(selector, fallbackToHref) { | 780 | this.click = function(selector, fallbackToHref) { |
781 | fallbackToHref = typeof(fallbackToHref) == "undefined" ? true : false; | 781 | fallbackToHref = typeof(fallbackToHref) == "undefined" ? true : !!fallbackToHref; |
782 | var elem = this.findOne(selector); | 782 | var elem = this.findOne(selector); |
783 | if (!elem) { | 783 | if (!elem) { |
784 | return false; | 784 | return false; | ... | ... |
-
Please register or sign in to post a comment