Better getJson fix

pull/223/head
Ruben Daniels 2015-10-21 22:09:26 +00:00
rodzic 026ca8d5e0
commit dfca5e1c1c
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -423,7 +423,7 @@ define(function(require, exports, module) {
function getJson(query) { function getJson(query) {
var json = get(query, true); var json = get(query, true);
if (query.indexOf("json()") == -1 && json["json()"]) if (query.indexOf("@") == -1 && query.indexOf("json()") == -1)
json = json["json()"]; json = json["json()"];
if (typeof json === "object") if (typeof json === "object")
@ -434,6 +434,7 @@ define(function(require, exports, module) {
return JSON.parse(json); return JSON.parse(json);
} catch (e) {} } catch (e) {}
} }
// do not return null or undefined so that getJson(query).foo never throws // do not return null or undefined so that getJson(query).foo never throws
return false; return false;
} }