Comparing version 1.0.0 to 1.0.1
@@ -79,23 +79,26 @@ /** | ||
return session.executeAsync(/* istanbul ignore next */ function (poller, args, timeout, pollInterval, done) { | ||
/* jshint evil:true */ | ||
poller = new Function(poller); | ||
return session.setExecuteAsyncTimeout(timeout).then(function () { | ||
/* jshint maxlen:140 */ | ||
return session.executeAsync(/* istanbul ignore next */ function (poller, args, timeout, pollInterval, done) { | ||
/* jshint evil:true */ | ||
poller = new Function(poller); | ||
var endTime = Number(new Date()) + timeout; | ||
var endTime = Number(new Date()) + timeout; | ||
(function poll() { | ||
var result = poller.apply(this, args); | ||
(function poll() { | ||
var result = poller.apply(this, args); | ||
/*jshint evil:true */ | ||
if (result != null) { | ||
done(result); | ||
} | ||
else if (Number(new Date()) < endTime) { | ||
setTimeout(poll, pollInterval); | ||
} | ||
else { | ||
done(null); | ||
} | ||
})(); | ||
}, [ util.toExecuteString(poller), args, timeout, pollInterval ]).finally(function (result) { | ||
/*jshint evil:true */ | ||
if (result != null) { | ||
done(result); | ||
} | ||
else if (Number(new Date()) < endTime) { | ||
setTimeout(poll, pollInterval); | ||
} | ||
else { | ||
done(null); | ||
} | ||
})(); | ||
}, [ util.toExecuteString(poller), args, timeout, pollInterval ]); | ||
}).finally(function (result) { | ||
function finish() { | ||
@@ -106,3 +109,5 @@ if (result instanceof Error) { | ||
else if (result === null) { | ||
throw new Error('Polling timed out with no result'); | ||
var error = new Error('Polling timed out with no result'); | ||
error.name = 'ScriptTimeout'; | ||
throw error; | ||
} | ||
@@ -109,0 +114,0 @@ else { |
{ | ||
"name": "leadfoot", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Leadfoot. A JavaScript client library that brings cross-platform consistency to the Selenium WebDriver API.", | ||
@@ -5,0 +5,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
193161
5098