Author: ankit
Date: 2005-12-14 02:33:35 -0500 (Wed, 14 Dec 2005)
New Revision: 54348

Modified:
   trunk/mcs/ilasm/codegen/ChangeLog
   trunk/mcs/ilasm/codegen/TypeDef.cs
   trunk/mcs/ilasm/tests/ChangeLog
   trunk/mcs/ilasm/tests/dotted-names.il
Log:
In ilasm/tests:
2005-12-14  Ankit Jain  <[EMAIL PROTECTED]>

        * dotted-names.il: Add test for class with no explicit namespace.

In ilasm/codegen:
2005-12-14  Ankit Jain  <[EMAIL PROTECTED]>

        * TypeDef.cs (TypeDef.ctor): name_space can be null.



Modified: trunk/mcs/ilasm/codegen/ChangeLog
===================================================================
--- trunk/mcs/ilasm/codegen/ChangeLog   2005-12-14 07:05:54 UTC (rev 54347)
+++ trunk/mcs/ilasm/codegen/ChangeLog   2005-12-14 07:33:35 UTC (rev 54348)
@@ -1,3 +1,7 @@
+2005-12-14  Ankit Jain  <[EMAIL PROTECTED]>
+
+       * TypeDef.cs (TypeDef.ctor): name_space can be null.
+
 2005-12-13  Ankit Jain  <[EMAIL PROTECTED]>
 
        * TypeDef.cs (TypeDef.ctor): Ensure that 'name' contains only the last 
part

Modified: trunk/mcs/ilasm/codegen/TypeDef.cs
===================================================================
--- trunk/mcs/ilasm/codegen/TypeDef.cs  2005-12-14 07:05:54 UTC (rev 54347)
+++ trunk/mcs/ilasm/codegen/TypeDef.cs  2005-12-14 07:33:35 UTC (rev 54348)
@@ -72,14 +72,18 @@
                         is_value_class = false;
                         is_enum_class = false;
 
-                       int lastdot = name.LastIndexOf ('.');
-                       if (lastdot >= 0) {
-                               this.name_space = name_space + "." + 
name.Substring (0, lastdot);
-                               this.name = name.Substring (lastdot + 1);
-                       } else {
-                               this.name_space = name_space;
-                               this.name = name;
-                       }
+
+                        int lastdot = name.LastIndexOf ('.');
+                        if (lastdot >= 0) {
+                                if (name_space == null || name_space == "")
+                                        this.name_space = name.Substring (0, 
lastdot);
+                                else
+                                        this.name_space = name_space + "." + 
name.Substring (0, lastdot);
+                                this.name = name.Substring (lastdot + 1);
+                        } else {
+                                this.name_space = name_space;
+                                this.name = name;
+                        }
                 }
 
                 public string Name {

Modified: trunk/mcs/ilasm/tests/ChangeLog
===================================================================
--- trunk/mcs/ilasm/tests/ChangeLog     2005-12-14 07:05:54 UTC (rev 54347)
+++ trunk/mcs/ilasm/tests/ChangeLog     2005-12-14 07:33:35 UTC (rev 54348)
@@ -1,3 +1,7 @@
+2005-12-14  Ankit Jain  <[EMAIL PROTECTED]>
+
+       * dotted-names.il: Add test for class with no explicit namespace.
+
 2005-12-13  Ankit Jain  <[EMAIL PROTECTED]>
 
        * dotted-names.il: New. Test for dotted names in namespace, class.

Modified: trunk/mcs/ilasm/tests/dotted-names.il
===================================================================
--- trunk/mcs/ilasm/tests/dotted-names.il       2005-12-14 07:05:54 UTC (rev 
54347)
+++ trunk/mcs/ilasm/tests/dotted-names.il       2005-12-14 07:33:35 UTC (rev 
54348)
@@ -1,10 +1,15 @@
 //Tests dotted names (namespace, class names)
 //It should emit namespace = A.B.C and type name = D
+//For E.F, namespace = E, name = F
 
-//.assembly extern mscorlib
-//{
-//}
+.assembly extern mscorlib
+{
+}
 
+.assembly Output 
+{
+}
+
 .module Output
 
 .namespace A.B {
@@ -15,3 +20,9 @@
 }
 
 }
+
+.class public auto autochar sealed beforefieldinit E.F 
+       extends [mscorlib]System.Object
+{
+}
+

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to