adding patch code to fix wonky array/objects
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 6 May 2005 01:33:59 +0000 (01:33 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 6 May 2005 01:33:59 +0000 (01:33 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@300 9efc2488-bf62-4759-914b-345cdb29e865

src/javascript/JSON.js

index 2c29f33..4c5c080 100644 (file)
@@ -40,6 +40,15 @@ function js2JSON(arg) {
                        if(arg) {
 
                                if (arg._isfieldmapper) { /* magi-c-ast for fieldmapper objects */
+
+                                       var arr = new Array();
+                                       if( arg.array.constructor != Array ) {
+                                               for( var i  = 0; i < arg.array.length, i++ ) {
+                                                       arr[i] = arg.array[i];
+                                               }
+                                               arg.array = arr;
+                                       }
+
                                        return "/*--S " + arg.classname + " --*/" + js2JSON(arg.array) + "/*--E " + arg.classname + " --*/";
 
                                } else {