From: erickson Date: Thu, 6 Mar 2008 17:28:04 +0000 (+0000) Subject: added support for hash-encoded json objects X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8723f8713a33288b113fbbcfaa602f3aa8b6b2b8;p=working%2FOpenSRF.git added support for hash-encoded json objects git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1258 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/javascript/JSON_v1.js b/src/javascript/JSON_v1.js index cfc0a36..7be5639 100644 --- a/src/javascript/JSON_v1.js +++ b/src/javascript/JSON_v1.js @@ -46,11 +46,19 @@ function decodeJS(arg) { eval('arg = new ' + arg[JSON_CLASS_KEY] + '(arg[JSON_DATA_KEY])'); } - jsIterate( arg, - function(o, i) { - o[i] = decodeJS(o[i]); - } - ); + if(arg._encodehash) { + jsIterate( arg.hash, + function(o, i) { + o[i] = decodeJS(o[i]); + } + ); + } else { + jsIterate( arg, + function(o, i) { + o[i] = decodeJS(o[i]); + } + ); + } return arg; }