svn commit r16481 - trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

svn commit r16481 - trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino

svn-9
Author: keith
Date: Fri May  2 20:42:34 2008
New Revision: 16481

Log:

Fixing the handling of arrays in a complex object case


Modified:
   trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptReceiver.java

Modified: trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptReceiver.java
==============================================================================
--- trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptReceiver.java (original)
+++ trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptReceiver.java Fri May  2 20:42:34 2008
@@ -473,7 +473,19 @@
                 NativeArray nativeArray = (NativeArray) jsObject;
                 Object[] objects = nativeArray.getAllIds();
                 for (int i = 0; i < objects.length; i++) {
-                    outElement.addChild(handleSchemaTypeinResponse(innerElement, objects[i],
+                    Object object = objects[i];
+                    Object o;
+                    if (object instanceof String) {
+                        String property = (String) object;
+                        if ("length".equals(property)) {
+                            continue;
+                        }
+                        o = nativeArray.get(property, nativeArray);
+                    } else {
+                        Integer property = (Integer) object;
+                        o = nativeArray.get(property.intValue(), nativeArray);
+                    }
+                    outElement.addChild(handleSchemaTypeinResponse(innerElement, o,
                                                                    factory, json));
                 }
             } else {

_______________________________________________
Wsf-javascript-dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/wsf-javascript-dev
Loading...