Commit 50ab02e1 50ab02e1fca1779f71980b7c58df1877a4b3aaa2 by Adam

Version check extended to support phantomjs v2.x

1 parent b62c37d9
...@@ -101,15 +101,17 @@ CasperError.prototype = Object.getPrototypeOf(new Error()); ...@@ -101,15 +101,17 @@ CasperError.prototype = Object.getPrototypeOf(new Error());
101 phantom.exit(); 101 phantom.exit();
102 } 102 }
103 103
104 (function(version) { 104 (function (version) {
105 // required version check 105 // required version check
106 if (version.major !== 1) { 106 if (version.major === 1) {
107 return __die('CasperJS needs PhantomJS v1.x'); 107 if (version.minor < 8) {
108 } if (version.minor < 8) { 108 return __die('CasperJS needs at least PhantomJS v1.8 or later.');
109 return __die('CasperJS needs at least PhantomJS v1.8 or later.'); 109 }
110 } 110 if (version.minor === 8 && version.patch < 1) {
111 if (version.minor === 8 && version.patch < 1) { 111 return __die('CasperJS needs at least PhantomJS v1.8.1 or later.');
112 return __die('CasperJS needs at least PhantomJS v1.8.1 or later.'); 112 }
113 } else if (version.major !== 2) {
114 return __die('CasperJS needs PhantomJS v1.x or v2.x');
113 } 115 }
114 })(phantom.version); 116 })(phantom.version);
115 117
......