From 8c973a40edeb5e3d065d7867a811b8a72d69ec2f Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 6 May 2005 01:33:59 +0000 Subject: [PATCH] adding patch code to fix wonky array/objects git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@300 9efc2488-bf62-4759-914b-345cdb29e865 --- src/javascript/JSON.js | 9 +++++++++ 1 file changed, 9 insertions(+) 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 { -- 2.11.0