Commit e13b9169 e13b91699bfa3f90077a0f9a4d00b8eaca1e3922 by Nicolas Perriault

added supplementary check for phantomjs version

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