public virtual void Execute(ExecEnvironment environment, IEnumerable <Value> arguments) { environment.OnFunctionCall(); RegisterParameters(environment, arguments); blockStatement.Execute(environment); if (environment.ReturnFlag && Type == TypeValue.Void) { throw new RuntimeException("Function must return result"); } environment.OnReturnFromFunction(); }