public static object GetSafeValue(Ast ast, ExecutionContext context, SafeValueContext safeValueContext) { s_context = context; if (IsSafeValueVisitor.IsAstSafe(ast, safeValueContext)) { return(ast.Accept(new GetSafeValueVisitor())); } if (safeValueContext == SafeValueContext.ModuleAnalysis) { return(null); } throw PSTraceSource.NewArgumentException("ast"); }
public static bool IsAstSafe(Ast ast, GetSafeValueVisitor.SafeValueContext safeValueContext) { IsSafeValueVisitor visitor = new IsSafeValueVisitor(safeValueContext); return(visitor.IsAstSafe(ast)); }