Commit 330f8a7a 330f8a7a9ae9f8788e56ac52c04f95e072d23558 by Christopher Van Committed by Christopher Van

fix code sample in `__utils__.findAll` documentation

this code doesn't work; `Array.prototype.forEach` should be `Array.prototype.map`.
1 parent 091bbc34
...@@ -109,7 +109,7 @@ Retrieves all DOM elements matching a given :ref:`selector expression <selectors ...@@ -109,7 +109,7 @@ Retrieves all DOM elements matching a given :ref:`selector expression <selectors
109 casper.start('http://foo.bar/', function() { 109 casper.start('http://foo.bar/', function() {
110 links = this.evaluate(function() { 110 links = this.evaluate(function() {
111 var elements = __utils__.findAll('a.menu'); 111 var elements = __utils__.findAll('a.menu');
112 return Array.prototype.forEach.call(elements, function(e) { 112 return elements.map(function(e) {
113 return e.getAttribute('href'); 113 return e.getAttribute('href');
114 }); 114 });
115 }); 115 });
......