kopia lustrzana https://github.com/c9/core
Better getJson fix
rodzic
026ca8d5e0
commit
dfca5e1c1c
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue