示例#1
0
 internal static void DefineFunction(ExecutionContext context, FunctionDefinitionAst functionDefinitionAst, ScriptBlockExpressionWrapper scriptBlockExpressionWrapper)
 {
     try
     {
         ScriptBlock scriptBlock = scriptBlockExpressionWrapper.GetScriptBlock(context, functionDefinitionAst.IsFilter);
         context.EngineSessionState.SetFunctionRaw(functionDefinitionAst.Name, scriptBlock, context.EngineSessionState.CurrentScope.ScopeOrigin);
     }
     catch (Exception exception)
     {
         CommandProcessorBase.CheckForSevereException(exception);
         RuntimeException exception2 = exception as RuntimeException;
         if (exception2 == null)
         {
             throw ExceptionHandlingOps.ConvertToRuntimeException(exception, functionDefinitionAst.Extent);
         }
         InterpreterError.UpdateExceptionErrorRecordPosition(exception2, functionDefinitionAst.Extent);
         throw;
     }
 }
示例#2
0
 internal static void DefineFunction(ExecutionContext context, FunctionDefinitionAst functionDefinitionAst, ScriptBlockExpressionWrapper scriptBlockExpressionWrapper)
 {
     try
     {
         ScriptBlock scriptBlock = scriptBlockExpressionWrapper.GetScriptBlock(context, functionDefinitionAst.IsFilter);
         context.EngineSessionState.SetFunctionRaw(functionDefinitionAst.Name, scriptBlock, context.EngineSessionState.CurrentScope.ScopeOrigin);
     }
     catch (Exception exception)
     {
         CommandProcessorBase.CheckForSevereException(exception);
         RuntimeException exception2 = exception as RuntimeException;
         if (exception2 == null)
         {
             throw ExceptionHandlingOps.ConvertToRuntimeException(exception, functionDefinitionAst.Extent);
         }
         InterpreterError.UpdateExceptionErrorRecordPosition(exception2, functionDefinitionAst.Extent);
         throw;
     }
 }