More commits to sync working copy
[gnome.introspection-doc-generator] / JSDOC / Token.js
index 98a9f2c..cad3547 100644 (file)
@@ -1,72 +1,72 @@
 //<Script type="text/javascript">
+
+imports['Object.js'].load(Object);
 JSDOC   = imports['JSDOC.js'].JSDOC;
-Roo     = imports['Roo.js'].Roo;
 console = imports['console.js'].console;
 /**
        @constructor
 */
-Token = function(data, type, name) {
-       this.data = data;
-       this.type = type;
-       this.name = name;
-    this.prefix = '';
-}
 
-//JSDOC.Token.prototype.toString = function() { 
-//     return "<"+this.type+" name=\""+this.name+"\">"+this.data+"</"+this.type+">";
-//}
-Roo.apply( Token.prototype, {
-    
-    toRaw : function(lvl)
+Token = Object.define(
+    function(data, type, name) {
+        this.data = data;
+        this.type = type;
+        this.name = name;
+        this.prefix = '';
+    }, 
+    Object, 
     {
-        lvl = lvl || 0;
         
-        var ret =  this.data ;
-        if (this.items) {
-            var ar = [];
-            Roo.each(this.items, function(ai) {
-                
-                var str = '';
-                Roo.each(ai, function(it) {
-                    str += it.toRaw(lvl + 1);
-                })
-                ar.push(str);
-                
-            })
-            ret +=   ar.join('');
+        toRaw : function(lvl)
+        {
+            lvl = lvl || 0;
             
-        }
-        if (this.props) {
-            for (var i in this.props) {
-                ret += this.props[i].key.toRaw(lvl+1) + ' : ';
-                Roo.each(this.props[i].val, function(e) {
-                    ret+=e.toRaw(lvl+1);
+            var ret =  this.data ;
+            if (this.items) {
+                var ar = [];
+                Roo.each(this.items, function(ai) {
+                    
+                    var str = '';
+                    Roo.each(ai, function(it) {
+                        str += it.toRaw(lvl + 1);
+                    })
+                    ar.push(str);
+                    
                 })
+                ret +=   ar.join('');
                 
             }
-        }
-        
-        
-        
-        return this.prefix +   ret;
+            if (this.props) {
+                for (var i in this.props) {
+                    ret += this.props[i].key.toRaw(lvl+1) + ' : ';
+                    Roo.each(this.props[i].val, function(e) {
+                        ret+=e.toRaw(lvl+1);
+                    })
+                    
+                }
+            }
+            
+            
+            
+            return this.prefix +   ret;
+             
+        },
+
+        toJS : function() {
+            
+            try {
+                var _tmp = '';
+                eval( "_tmp = " + this.data);
+                return _tmp;
+            } catch( e) {
+                return "ERROR unparsable" + this.data;
+            }
+        },
          
-    },
+                        
 
-    toJS : function() {
-        
-        try {
-            var _tmp = '';
-            eval( "_tmp = " + this.data);
-            return _tmp;
-        } catch( e) {
-            return "ERROR unparsable" + this.data;
+        is : function(what) {
+            return this.name === what || this.type === what;
         }
-    },
-     
-                    
-
-    is : function(what) {
-        return this.name === what || this.type === what;
-    }
 });
      
\ No newline at end of file