Version check extended to support phantomjs v2.x
Showing
1 changed file
with
6 additions
and
4 deletions
... | @@ -101,16 +101,18 @@ CasperError.prototype = Object.getPrototypeOf(new Error()); | ... | @@ -101,16 +101,18 @@ 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) { | ||
109 | return __die('CasperJS needs at least PhantomJS v1.8 or later.'); | 108 | return __die('CasperJS needs at least PhantomJS v1.8 or later.'); |
110 | } | 109 | } |
111 | if (version.minor === 8 && version.patch < 1) { | 110 | if (version.minor === 8 && version.patch < 1) { |
112 | return __die('CasperJS needs at least PhantomJS v1.8.1 or later.'); | 111 | return __die('CasperJS needs at least PhantomJS v1.8.1 or later.'); |
113 | } | 112 | } |
113 | } else if (version.major !== 2) { | ||
114 | return __die('CasperJS needs PhantomJS v1.x or v2.x'); | ||
115 | } | ||
114 | })(phantom.version); | 116 | })(phantom.version); |
115 | 117 | ||
116 | // Hooks in default phantomjs error handler | 118 | // Hooks in default phantomjs error handler | ... | ... |
-
Please register or sign in to post a comment