Version check extended to support phantomjs v2.x
Showing
1 changed file
with
10 additions
and
8 deletions
... | @@ -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 | ... | ... |
-
Please register or sign in to post a comment