Commit 00ae83c8 00ae83c8dfe47faa638160cf1c76ef23c46cd762 by Nicolas Perriault

simplified CasopeR.getGlobal()

1 parent c6977c14
......@@ -871,14 +871,13 @@ Casper.prototype.getGlobal = function getGlobal(name) {
}
return result;
}, name);
if (typeof result !== "object") {
if (!utils.isObject(result)) {
throw new CasperError(f('Could not retrieve global value for "%s"', name));
} else if ('error' in result) {
throw new CasperError(result.error);
} else if (utils.isString(result.value)) {
return JSON.parse(result.value);
}
return undefined;
};
/**
......