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/Vsa ScriptStream.cs,1.1,1.2


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/JScript/Vsa ScriptStream.cs,1.1,1.2 VsaEngine.cs,1.3,1.4
Date: Fri, 30 May 2003 23:32:04 -0400

Update of /cvsroot/dotgnu-pnet/pnetlib/JScript/Vsa
In directory subversions:/tmp/cvs-serv32646/JScript/Vsa

Modified Files:
        ScriptStream.cs VsaEngine.cs 
Log Message:


Add the CONFIG_SMALL_CONSOLE profile option, which strips
System.Console down to a smaller size.


Index: ScriptStream.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/JScript/Vsa/ScriptStream.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** ScriptStream.cs     13 Jan 2003 10:53:21 -0000      1.1
--- ScriptStream.cs     31 May 2003 03:32:02 -0000      1.2
***************
*** 27,30 ****
--- 27,33 ----
  public class ScriptStream
  {
+ 
+ #if !CONFIG_SMALL_CONSOLE
+ 
        // Global stdout and stderr streams.
        public static TextWriter Out = Console.Out;
***************
*** 60,63 ****
--- 63,99 ----
                                Out.WriteLine(str);
                        }
+ 
+ #else // CONFIG_SMALL_CONSOLE
+ 
+       // Print an exception stack trace.
+       public static void PrintStackTrace(Exception e)
+                       {
+                               Console.WriteLine(e.StackTrace);
+                       }
+       public static void PrintStackTrace()
+                       {
+                               // Get the stack trace for the current method
+                               // by throwing a dummy exception.
+                               try
+                               {
+                                       throw new Exception();
+                               }
+                               catch(Exception e)
+                               {
+                                       PrintStackTrace(e);
+                               }
+                       }
+ 
+       // Write a string to stdout.
+       public static void Write(String str)
+                       {
+                               Console.Write(str);
+                       }
+       public static void WriteLine(String str)
+                       {
+                               Console.WriteLine(str);
+                       }
+ 
+ #endif // CONFIG_SMALL_CONSOLE
  
  }; // class ScriptStream

Index: VsaEngine.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/JScript/Vsa/VsaEngine.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** VsaEngine.cs        14 Feb 2003 05:57:41 -0000      1.3
--- VsaEngine.cs        31 May 2003 03:32:02 -0000      1.4
***************
*** 188,193 ****
--- 188,195 ----
                                        {
                                                Globals.contextEngine = null;
+ #if !CONFIG_SMALL_CONSOLE
                                                ScriptStream.Out = Console.Out;
                                                ScriptStream.Error = 
Console.Error;
+ #endif
                                        }
                                }
***************
*** 347,354 ****
--- 349,358 ----
                                        else
                                        {
+ #if !CONFIG_SMALL_CONSOLE
                                                // Use the global 
"ScriptStream" class for the
                                                // default engine instance.
                                                ScriptStream.Out = writer;
                                                ScriptStream.Error = writer;
+ #endif
                                        }
                                }





reply via email to

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