dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/JScript/Execute Convert.cs,1.3,1.4


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/JScript/Execute Convert.cs,1.3,1.4
Date: Thu, 06 Mar 2003 18:52:42 -0500

Update of /cvsroot/dotgnu-pnet/pnetlib/JScript/Execute
In directory subversions:/tmp/cvs-serv30549/JScript/Execute

Modified Files:
        Convert.cs 
Log Message:


Implementation and test cases for the functions in the JScript global object.


Index: Convert.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/JScript/Execute/Convert.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** Convert.cs  21 Jan 2003 22:11:49 -0000      1.3
--- Convert.cs  6 Mar 2003 23:52:40 -0000       1.4
***************
*** 587,592 ****
        public static String ToString(Object value, bool explicitOK)
                        {
!                               // TODO
!                               return value.ToString();
                        }
        internal static String ToString(Object value)
--- 587,617 ----
        public static String ToString(Object value, bool explicitOK)
                        {
!                               // Bail out immediately if it is already a 
string.
!                               String s = (value as String);
!                               if(s != null)
!                               {
!                                       return s;
!                               }
! 
!                               // Handle conversions of null values.
!                               if(value == null)
!                               {
!                                       return (explicitOK ? "undefined" : 
null);
!                               }
!                               else if(DBNull.IsDBNull(value))
!                               {
!                                       return (explicitOK ? "null" : null);
!                               }
! 
!                               // Use the standard "Object.ToString()" method.
!                               s = value.ToString();
!                               if(s != null)
!                               {
!                                       return s;
!                               }
!                               else
!                               {
!                                       return (explicitOK ? "undefined" : 
null);
!                               }
                        }
        internal static String ToString(Object value)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]