Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
fix(elementexplorer): eval always treat result as promise
Browse files Browse the repository at this point in the history
  • Loading branch information
hankduan committed Nov 21, 2014
1 parent 2f245ee commit 6a9b87c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bin/elementexplorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ var flowEval = function(code, context, file, callback) {
process.domain.emit('error', vmErr);
process.domain.exit();
}
return result.then(function(val) {return val});

if (webdriver.promise.isPromise(result)) {
return result.then(function(val) {return val});
} else {
return result;
}
}).then(function(res) {
if (!vmErr) {
callback(null, res);
Expand Down

0 comments on commit 6a9b87c

Please sign in to comment.