From 8723f8713a33288b113fbbcfaa602f3aa8b6b2b8 Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 6 Mar 2008 17:28:04 +0000 Subject: [PATCH] added support for hash-encoded json objects git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1258 9efc2488-bf62-4759-914b-345cdb29e865 --- src/javascript/JSON_v1.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) 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; } -- 2.11.0