Commit 27ce6e3d 27ce6e3d106f829ca3c629570d68ea4e29abada5 by Nicolas Perriault

phantom.exit() compatibility with phantomjs 1.7-dev

1 parent 7bb28449
......@@ -276,16 +276,18 @@ if (!phantom || phantom.version.major !== 1 || phantom.version.minor < 5) {
phantom.casperScript = phantom.casperArgs.get(0);
}
if (!fs.isFile(phantom.casperScript)) {
console.error('Unable to open file: ' + phantom.casperScript);
phantom.exit(1);
}
// filter out the called script name from casper args
phantom.casperArgs.drop(phantom.casperScript);
if (phantom.casperScript) {
if (!fs.isFile(phantom.casperScript)) {
console.error('Unable to open file: ' + phantom.casperScript);
phantom.exit(1);
} else {
// filter out the called script name from casper args
phantom.casperArgs.drop(phantom.casperScript);
// passed casperjs script execution
phantom.injectJs(phantom.casperScript);
// passed casperjs script execution
phantom.injectJs(phantom.casperScript);
}
}
};
if (!phantom.casperLoaded) {
......