Commit e13b9169 e13b91699bfa3f90077a0f9a4d00b8eaca1e3922 by Nicolas Perriault

added supplementary check for phantomjs version

1 parent 07c54ee5
...@@ -579,7 +579,7 @@ ...@@ -579,7 +579,7 @@
579 */ 579 */
580 function createPage(casper) { 580 function createPage(casper) {
581 var page; 581 var page;
582 if (phantom.version.major <= 1 && phantom.version.minor < 3) { 582 if (phantom.version.major <= 1 && phantom.version.minor < 3 && typeof(require) === "function") {
583 page = new WebPage(); 583 page = new WebPage();
584 } else { 584 } else {
585 page = require('webpage').create(); 585 page = require('webpage').create();
...@@ -642,7 +642,7 @@ ...@@ -642,7 +642,7 @@
642 if (!what || typeof(what) !== "object") { 642 if (!what || typeof(what) !== "object") {
643 return false; 643 return false;
644 } 644 }
645 if (phantom.version.major <= 1 && phantom.version.minor < 3) { 645 if (phantom.version.major <= 1 && phantom.version.minor < 3 && typeof(require) === "function") {
646 return what instanceof WebPage; 646 return what instanceof WebPage;
647 } else { 647 } else {
648 return what.toString().indexOf('WebPage(') === 0; 648 return what.toString().indexOf('WebPage(') === 0;
......