Revision: 1753
          http://svn.sourceforge.net/vexi/?rev=1753&view=rev
Author:   mkpg2
Date:     2007-03-26 08:52:10 -0700 (Mon, 26 Mar 2007)

Log Message:
-----------
Development

Modified Paths:
--------------
    core/trunk/org.vexi.devl/src/org/ibex/js/ScopeInfoManager.java
    core/trunk/org.vexi.devl/src/org/vexi/debug/Constants.java
    core/trunk/org.vexi.devl/src_junit/test/debug/fetchprops/testArray.t

Modified: core/trunk/org.vexi.devl/src/org/ibex/js/ScopeInfoManager.java
===================================================================
--- core/trunk/org.vexi.devl/src/org/ibex/js/ScopeInfoManager.java      
2007-03-26 15:50:21 UTC (rev 1752)
+++ core/trunk/org.vexi.devl/src/org/ibex/js/ScopeInfoManager.java      
2007-03-26 15:52:10 UTC (rev 1753)
@@ -122,8 +122,30 @@
                Hashtable h = new Hashtable();
            h.put("name",name);
            if(!"".equals(nametype))h.put("nametype",nametype);
-           String type = typeOfJS(jsvalue);
+           
            Object value = "";
+           String type;
+               
+           ///////
+           // TYPE
+           ///////
+           if(jsvalue == null){
+                       type = VARTYPE_NULL;
+               }else if(jsvalue instanceof JSPrimitive){
+                       type = VARTYPE_PRIMITIVE;
+       }else if(jsvalue instanceof JS.Obj){
+               type = VARTYPE_OBJECT;
+               h.put("id", ((JS.Obj)jsvalue).hashCode()+"");
+               }else if(jsvalue instanceof JSFunction){
+                       type = VARTYPE_FUNCTION;
+                       h.put("location", 
((JSFunction)jsvalue).sourceName+":"+((JSFunction)jsvalue).firstLine);
+               }else if(jsvalue instanceof JSArray){
+                       type = VARTYPE_ARRAY;
+                       h.put("length",((JSArray)jsvalue).size()+"");
+               }else{
+                       type = VARTYPE_UNKNOWN;
+               }
+           addTypeInfo(h, jsvalue);
            try {
                value = valueOfJS(jsvalue);
         } catch (JSExn e) {
@@ -131,33 +153,19 @@
                        type = "debuggererror";
                        value = e.getMessage();
                }
-           h.put("type", type);
            h.put("value",value);
+           h.put("type",type);
            if(type.equals(VARTYPE_OBJECT)){
                Vector path = new Vector();
                path.add(name);
                ObjTree ot = get(path);
                if(ot!=null) h.put("value", ot.contructObjChildren(jsvalue));
            }
-           
-           //h.put("scopeDepth", new Integer(scopeDepth));
            return h;
        }
        
-       private static String typeOfJS(JS jsvalue){
-               String type;
-           if(jsvalue == null){
-                       type = VARTYPE_NULL;
-               }else if(jsvalue instanceof JSPrimitive){
-            type = VARTYPE_PRIMITIVE;
-       }else if(jsvalue instanceof JS.Obj){
-                       type = VARTYPE_OBJECT;
-               }else if(jsvalue instanceof JSFunction){
-                       type = VARTYPE_FUNCTION;
-               }else{
-                       type = VARTYPE_UNKNOWN;
-               }
-           return type;
+       private static void addTypeInfo(Hashtable h, JS jsvalue){
+
        }
        
        private static Object valueOfJS(JS jsvalue) throws JSExn{

Modified: core/trunk/org.vexi.devl/src/org/vexi/debug/Constants.java
===================================================================
--- core/trunk/org.vexi.devl/src/org/vexi/debug/Constants.java  2007-03-26 
15:50:21 UTC (rev 1752)
+++ core/trunk/org.vexi.devl/src/org/vexi/debug/Constants.java  2007-03-26 
15:52:10 UTC (rev 1753)
@@ -6,6 +6,7 @@
        static final public String VARTYPE_PRIMITIVE = "primitive";
        static final public String VARTYPE_OBJECT = "object";
        static final public String VARTYPE_FUNCTION = "function";
+       static final public String VARTYPE_ARRAY = "array";
        static final public String VARTYPE_UNKNOWN = "?";
        
        

Modified: core/trunk/org.vexi.devl/src_junit/test/debug/fetchprops/testArray.t
===================================================================
--- core/trunk/org.vexi.devl/src_junit/test/debug/fetchprops/testArray.t        
2007-03-26 15:50:21 UTC (rev 1752)
+++ core/trunk/org.vexi.devl/src_junit/test/debug/fetchprops/testArray.t        
2007-03-26 15:52:10 UTC (rev 1753)
@@ -8,6 +8,8 @@
                tc..resume();tc..waitForHalt();
                server..fetchProps(["array"]);
                // Test first level
+               .util..assertEquals(4,model..vars.array.length);
+               .util..assertEquals("array",model..vars.array.type);
                .util..assertEquals(3,model..vars.array.value["0:n"].value);
                .util..assertEquals(2,model..vars.array.value["1:n"].value);
                .util..assertEquals(1,model..vars.array.value["2:n"].value);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to