Commit db868022 db86802213629502bd07196b801972c02d5b34a8 by Nicolas Perriault

fixed missing check for Casper.options.httpStatusHandlers values

1 parent dbeb1a41
......@@ -125,8 +125,10 @@ function createPage(casper) {
}
if (resource.url === casper.requestUrl && resource.stage === "start") {
casper.currentHTTPStatus = resource.status;
if (isType(casper.options.httpStatusHandlers, "object") && resource.status in casper.options.httpStatusHandlers) {
casper.options.httpStatusHandlers[resource.status](casper, resource);
if (isType(casper.options.httpStatusHandlers, "object") &&
resource.status in casper.options.httpStatusHandlers &&
isType(casper.options.httpStatusHandlers[resource.status], "function")) {
casper.options.httpStatusHandlers[resource.status].call(casper, casper, resource);
}
casper.currentUrl = resource.url;
}
......@@ -228,7 +230,7 @@ function isWebPage(what) {
function mergeObjects(obj1, obj2) {
for (var p in obj2) {
try {
if (obj2[p].constructor == Object) {
if (obj2[p].constructor === Object) {
obj1[p] = mergeObjects(obj1[p], obj2[p]);
} else {
obj1[p] = obj2[p];
......