Commit 4f765725 4f76572555c28afd1a0a0baf33e49de9f6984e84 by hexid

Change getElementsAttribute to use Array.map()

1 parent a41a81c8
...@@ -909,12 +909,9 @@ Casper.prototype.getElementsAttr = function getElementsAttr(selector, attribute) ...@@ -909,12 +909,9 @@ Casper.prototype.getElementsAttr = function getElementsAttr(selector, attribute)
909 "use strict"; 909 "use strict";
910 this.checkStarted(); 910 this.checkStarted();
911 return this.evaluate(function _evaluate(selector, attribute) { 911 return this.evaluate(function _evaluate(selector, attribute) {
912 var ele = []; 912 return Array.prototype.map.call(__utils__.findAll(selector), function(element) {
913 [].forEach.call(__utils__.findAll(selector), function(element) { 913 return element.getAttribute(attribute);
914 var e = element.getAttribute(attribute);
915 ele.push(e);
916 }); 914 });
917 return ele;
918 }, selector, attribute); 915 }, selector, attribute);
919 } 916 }
920 917
......