Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
e5d13edf
...
e5d13edf5010c98cd59eab26b04c0c6b90d4878a
authored
2012-05-27 23:24:41 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed `each()` method which was broken
regression occured in
dd5c9fda
1 parent
3aa64e34
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
modules/casper.js
modules/casper.js
View file @
e5d13ed
...
...
@@ -226,11 +226,7 @@ Casper.prototype.checkStep = function checkStep(self, onComplete) {
clearInterval
(
self
.
checker
);
self
.
emit
(
'run.complete'
);
if
(
utils
.
isFunction
(
onComplete
))
{
try
{
onComplete
.
call
(
self
,
self
);
}
catch
(
err
)
{
self
.
log
(
"Could not complete final step: "
+
err
,
"error"
);
}
}
else
{
// default behavior is to exit
self
.
exit
();
...
...
@@ -375,9 +371,11 @@ Casper.prototype.each = function each(array, fn) {
this
.
log
(
"each() only works with arrays"
,
"error"
);
return
this
;
}
array
.
forEach
.
call
(
this
,
function
_forEach
(
item
,
i
)
{
fn
.
call
(
this
,
this
,
item
,
i
);
(
function
_each
(
self
)
{
array
.
forEach
(
function
_forEach
(
item
,
i
)
{
fn
.
call
(
self
,
self
,
item
,
i
);
});
})(
this
);
return
this
;
};
...
...
Please
register
or
sign in
to post a comment