From: erickson Date: Fri, 6 May 2005 01:33:59 +0000 (+0000) Subject: adding patch code to fix wonky array/objects X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8c973a40edeb5e3d065d7867a811b8a72d69ec2f;p=working%2FOpenSRF.git adding patch code to fix wonky array/objects git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@300 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/javascript/JSON.js b/src/javascript/JSON.js index 2c29f33..4c5c080 100644 --- a/src/javascript/JSON.js +++ b/src/javascript/JSON.js @@ -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 {