2005-07-17 Florian Gross <flgr@ccan.de>
[mono.git] / mcs / class / Microsoft.JScript / Microsoft.JScript / FunctionObject.cs
index bbc82b46a5ea17d3de997d99d7aa53b25b7fd6e2..8fdcb5c2f9342f9d1503f5b2483c4a4ffc4d8bf7 100644 (file)
@@ -37,7 +37,6 @@ namespace Microsoft.JScript {
 
        public class FunctionObject : ScriptFunction {
 
-               internal MethodAttributes attr;
                internal string name;
                internal string type_annot;
                internal Type return_type;
@@ -49,6 +48,14 @@ namespace Microsoft.JScript {
                        this.name = name;
                }
 
+               internal FunctionObject (MethodInfo info)
+               {
+                       this.method = info;
+                       this.name = info.Name;
+                       this.attr = info.Attributes;
+                       this.return_type = info.ReturnType;
+               }
+
                internal FunctionObject (string name, FormalParameterList p, string ret_type, Block body)
                {
                        //
@@ -89,7 +96,7 @@ namespace Microsoft.JScript {
                                sb.Append (this.parameters.ToString ());
                                        
                        sb.Append (")");
-                       if (return_type != null)
+                       if (return_type != null && return_type != typeof (void))
                                sb.Append (" : " + return_type);
                        sb.Append (" {\n");