ParseEvalBody() public method

public ParseEvalBody ( ) : Block
return Block
Beispiel #1
0
 public static Object JScriptEvaluate(Object source, VsaEngine engine){
   if (Convert.GetTypeCode(source) != TypeCode.String)
     return source;
   if (engine.doFast)
     engine.PushScriptObject(new BlockScope(engine.ScriptObjectStackTop()));
   try{
     Context context = new Context(new DocumentContext("eval code", engine), ((IConvertible)source).ToString());
     JSParser p = new JSParser(context);
     return ((Completion)p.ParseEvalBody().PartiallyEvaluate().Evaluate()).value;
   }finally{
     if (engine.doFast)
       engine.PopScriptObject();
   }
 }
Beispiel #2
0
 private static Object DoEvaluate(Object source, VsaEngine engine, bool isUnsafe)
 {
     if (engine.doFast)
     {
         engine.PushScriptObject(new BlockScope(engine.ScriptObjectStackTop()));
     }
     try{
         Context  context = new Context(new DocumentContext("eval code", engine), ((IConvertible)source).ToString());
         JSParser p       = new JSParser(context);
         if (!isUnsafe)
         {
             new SecurityPermission(SecurityPermissionFlag.Execution).PermitOnly();
         }
         return(((Completion)p.ParseEvalBody().PartiallyEvaluate().Evaluate()).value);
     }finally{
         if (engine.doFast)
         {
             engine.PopScriptObject();
         }
     }
 }
Beispiel #3
0
 public static Object JScriptEvaluate(Object source, VsaEngine engine)
 {
     if (Convert.GetTypeCode(source) != TypeCode.String)
     {
         return(source);
     }
     if (engine.doFast)
     {
         engine.PushScriptObject(new BlockScope(engine.ScriptObjectStackTop()));
     }
     try{
         Context  context = new Context(new DocumentContext("eval code", engine), ((IConvertible)source).ToString());
         JSParser p       = new JSParser(context);
         return(((Completion)p.ParseEvalBody().PartiallyEvaluate().Evaluate()).value);
     }finally{
         if (engine.doFast)
         {
             engine.PopScriptObject();
         }
     }
 }
 private static object DoEvaluate(object source, VsaEngine engine, bool isUnsafe)
 {
     object obj2;
     if (engine.doFast)
     {
         engine.PushScriptObject(new BlockScope(engine.ScriptObjectStackTop()));
     }
     try
     {
         Context context = new Context(new DocumentContext("eval code", engine), ((IConvertible) source).ToString());
         JSParser parser = new JSParser(context);
         obj2 = ((Completion) parser.ParseEvalBody().PartiallyEvaluate().Evaluate()).value;
     }
     finally
     {
         if (engine.doFast)
         {
             engine.PopScriptObject();
         }
     }
     return obj2;
 }
Beispiel #5
0
        private static object DoEvaluate(object source, VsaEngine engine, bool isUnsafe)
        {
            object obj2;

            if (engine.doFast)
            {
                engine.PushScriptObject(new BlockScope(engine.ScriptObjectStackTop()));
            }
            try
            {
                Context  context = new Context(new DocumentContext("eval code", engine), ((IConvertible)source).ToString());
                JSParser parser  = new JSParser(context);
                obj2 = ((Completion)parser.ParseEvalBody().PartiallyEvaluate().Evaluate()).value;
            }
            finally
            {
                if (engine.doFast)
                {
                    engine.PopScriptObject();
                }
            }
            return(obj2);
        }
Beispiel #6
0
      private static Object DoEvaluate(Object source, VsaEngine engine, bool isUnsafe){
        if (engine.doFast)
          engine.PushScriptObject(new BlockScope(engine.ScriptObjectStackTop()));
        try{
          Context context = new Context(new DocumentContext("eval code", engine), ((IConvertible)source).ToString());
          JSParser p = new JSParser(context);
          if (!isUnsafe)
            new SecurityPermission(SecurityPermissionFlag.Execution).PermitOnly();
          return ((Completion)p.ParseEvalBody().PartiallyEvaluate().Evaluate()).value;
        }finally{
          if (engine.doFast)
            engine.PopScriptObject();
        }

      }