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)
"use strict";
this.checkStarted();
return this.evaluate(function _evaluate(selector, attribute) {
var ele = [];
[].forEach.call(__utils__.findAll(selector), function(element) {
var e = element.getAttribute(attribute);
ele.push(e);
return Array.prototype.map.call(__utils__.findAll(selector), function(element) {
return element.getAttribute(attribute);
});
return ele;
}, selector, attribute);
}
......