[Opensrf-commits] r1258 - trunk/src/javascript

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Mar 6 13:00:35 EST 2008


Author: erickson
Date: 2008-03-06 12:28:04 -0500 (Thu, 06 Mar 2008)
New Revision: 1258

Modified:
   trunk/src/javascript/JSON_v1.js
Log:
added support for hash-encoded json objects

Modified: trunk/src/javascript/JSON_v1.js
===================================================================
--- trunk/src/javascript/JSON_v1.js	2008-03-06 17:22:21 UTC (rev 1257)
+++ trunk/src/javascript/JSON_v1.js	2008-03-06 17:28:04 UTC (rev 1258)
@@ -46,11 +46,19 @@
 		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;
 }



More information about the opensrf-commits mailing list