Exemple #1
0
      private static void Main()
      {
         try
         {
            Console.WriteLine("Loading...");
            
            Uglifier uglifier = new Uglifier();

            Console.WriteLine("Uglify loaded");

            var result = uglifier.Uglify("var asdfg = 1234;");

            Console.WriteLine(result);
         }
         catch (TargetInvocationException exception)
         {
            Console.WriteLine(exception.InnerException);
         }
         catch (Exception exception)
         {
            Console.WriteLine(exception);
         }

         Console.WriteLine();
         Console.WriteLine();
         Console.WriteLine("Press any key to exit.");
         Console.ReadKey();
      }
      public void Uglify_ReturnsUglifiedCode()
      {
         var uglifier = new Uglifier();

         // TODO: Find verbose and complicated code to uglify.
         uglifier.Uglify("(function(){ var x = 'hello world'; }();");
      }
Exemple #3
0
      private static void Main()
      {
         try
         {
            Console.WriteLine("Loading...");

            Uglifier uglifier = new Uglifier();
            Console.WriteLine("Uglify executed!");

            var uglyCode = uglifier.Uglify("var a = 1 + 1;");
            Console.WriteLine("Code: " + uglyCode);
         }
         catch (TargetInvocationException exception)
         {
            Console.WriteLine(exception.InnerException);
         }
         catch (Exception exception)
         {
            Console.WriteLine(exception);
         }

         Console.WriteLine();
         Console.WriteLine();
         Console.WriteLine("Press any key to exit.");
         Console.ReadKey();
      }