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) { ...@@ -276,16 +276,18 @@ if (!phantom || phantom.version.major !== 1 || phantom.version.minor < 5) {
276 phantom.casperScript = phantom.casperArgs.get(0); 276 phantom.casperScript = phantom.casperArgs.get(0);
277 } 277 }
278 278
279 if (!fs.isFile(phantom.casperScript)) { 279 if (phantom.casperScript) {
280 console.error('Unable to open file: ' + phantom.casperScript); 280 if (!fs.isFile(phantom.casperScript)) {
281 phantom.exit(1); 281 console.error('Unable to open file: ' + phantom.casperScript);
282 } 282 phantom.exit(1);
283 283 } else {
284 // filter out the called script name from casper args 284 // filter out the called script name from casper args
285 phantom.casperArgs.drop(phantom.casperScript); 285 phantom.casperArgs.drop(phantom.casperScript);
286 286
287 // passed casperjs script execution 287 // passed casperjs script execution
288 phantom.injectJs(phantom.casperScript); 288 phantom.injectJs(phantom.casperScript);
289 }
290 }
289 }; 291 };
290 292
291 if (!phantom.casperLoaded) { 293 if (!phantom.casperLoaded) {
......