Commit 0c2c4666 0c2c466629e2510755354e75d7297bf8ef267ba0 by Nicolas Perriault

fixed Casper.click default value casting of the 'fallbackToHref' arg

1 parent 90afad2b
...@@ -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;
......