fixed missing check for Casper.options.httpStatusHandlers values
Showing
1 changed file
with
5 additions
and
3 deletions
... | @@ -125,8 +125,10 @@ function createPage(casper) { | ... | @@ -125,8 +125,10 @@ function createPage(casper) { |
125 | } | 125 | } |
126 | if (resource.url === casper.requestUrl && resource.stage === "start") { | 126 | if (resource.url === casper.requestUrl && resource.stage === "start") { |
127 | casper.currentHTTPStatus = resource.status; | 127 | casper.currentHTTPStatus = resource.status; |
128 | if (isType(casper.options.httpStatusHandlers, "object") && resource.status in casper.options.httpStatusHandlers) { | 128 | if (isType(casper.options.httpStatusHandlers, "object") && |
129 | casper.options.httpStatusHandlers[resource.status](casper, resource); | 129 | resource.status in casper.options.httpStatusHandlers && |
130 | isType(casper.options.httpStatusHandlers[resource.status], "function")) { | ||
131 | casper.options.httpStatusHandlers[resource.status].call(casper, casper, resource); | ||
130 | } | 132 | } |
131 | casper.currentUrl = resource.url; | 133 | casper.currentUrl = resource.url; |
132 | } | 134 | } |
... | @@ -228,7 +230,7 @@ function isWebPage(what) { | ... | @@ -228,7 +230,7 @@ function isWebPage(what) { |
228 | function mergeObjects(obj1, obj2) { | 230 | function mergeObjects(obj1, obj2) { |
229 | for (var p in obj2) { | 231 | for (var p in obj2) { |
230 | try { | 232 | try { |
231 | if (obj2[p].constructor == Object) { | 233 | if (obj2[p].constructor === Object) { |
232 | obj1[p] = mergeObjects(obj1[p], obj2[p]); | 234 | obj1[p] = mergeObjects(obj1[p], obj2[p]); |
233 | } else { | 235 | } else { |
234 | obj1[p] = obj2[p]; | 236 | obj1[p] = obj2[p]; | ... | ... |
-
Please register or sign in to post a comment