public System.Object VisitThrowStatement(System.Management.Automation.Language.ThrowStatementAst throwStatementAst) { IScriptExtent mappedExtent = MapExtent(throwStatementAst.Extent); PipelineBaseAst mappedPipeline = _VisitPipelineBase(throwStatementAst.Pipeline); return(new ThrowStatementAst(mappedExtent, mappedPipeline)); }
public override AstVisitAction VisitThrowStatement(ThrowStatementAst ast) { return CheckParent(ast); }
public object VisitThrowStatement(ThrowStatementAst throwStatementAst) { return(false); }
public object VisitThrowStatement(ThrowStatementAst throwStatementAst) { throw PSTraceSource.NewArgumentException("ast"); }
public override AstVisitAction VisitThrowStatement(ThrowStatementAst ast) { return(Check(ast)); }
public object VisitThrowStatement(ThrowStatementAst throwStatementAst) { this.ControlFlowStatement(throwStatementAst.Pipeline); return(null); }
public override AstVisitAction VisitThrowStatement(ThrowStatementAst throwStatementAst) { throw new NotImplementedException(); //VisitThrowStatement(throwStatementAst); }
public override AstVisitAction VisitThrowStatement(ThrowStatementAst throwStatementAst) { object targetObject = GetTargetObject(throwStatementAst); if (targetObject is Exception) { throw (Exception)targetObject; } string errorMessage = GetErrorMessageForThrowStatement(targetObject); throw new RuntimeException(errorMessage); }
public override AstVisitAction VisitThrowStatement(ThrowStatementAst ast) { return this.Check(ast); }
public override AstVisitAction VisitThrowStatement(ThrowStatementAst throwStatementAst) { this.ReportError(throwStatementAst, () => ParserStrings.FlowControlStatementNotSupportedInDataSection, new object[0]); return(AstVisitAction.Continue); }
public object VisitThrowStatement(ThrowStatementAst throwStatementAst) { throw new UnexpectedElementException(); }
/// <summary/> public virtual AstVisitAction VisitThrowStatement(ThrowStatementAst throwStatementAst) => DefaultVisit(throwStatementAst);
public object VisitThrowStatement(ThrowStatementAst throwStatementAst) { Expression expr = throwStatementAst.IsRethrow ? _currentExceptionBeingHandled : ((throwStatementAst.Pipeline == null) ? ExpressionCache.NullConstant : this.CaptureStatementResults(throwStatementAst.Pipeline, CaptureAstContext.Assignment, null)); return Expression.Block(this.UpdatePosition(throwStatementAst), Expression.Throw(Expression.Call(CachedReflectionInfo.ExceptionHandlingOps_ConvertToException, expr.Convert(typeof(object)), Expression.Constant(throwStatementAst.Extent)))); }
/// <summary/> public virtual object VisitThrowStatement(ThrowStatementAst throwStatementAst) { return null; }
/// <summary/> public virtual object VisitThrowStatement(ThrowStatementAst throwStatementAst) { return _decorated.VisitThrowStatement(throwStatementAst); }
public object VisitThrowStatement(ThrowStatementAst throwStatementAst) { return AutomationNull.Value; }
private object GetTargetObject(ThrowStatementAst throwStatementAst) { if (throwStatementAst.Pipeline != null) { object targetObject = EvaluateAst(throwStatementAst.Pipeline, false); if (targetObject is PSObject) { return ((PSObject)targetObject).BaseObject; } return targetObject; } return null; }
public object VisitThrowStatement(ThrowStatementAst throwStatementAst) { // We should not preserve the partial output if exception is thrown when evaluating throwStmt.pipeline. Expression throwExpr = throwStatementAst.IsRethrow ? s_currentExceptionBeingHandled : (throwStatementAst.Pipeline == null) ? ExpressionCache.NullConstant : CaptureStatementResults(throwStatementAst.Pipeline, CaptureAstContext.AssignmentWithoutResultPreservation); return Expression.Block( UpdatePosition(throwStatementAst), Expression.Throw(Expression.Call(CachedReflectionInfo.ExceptionHandlingOps_ConvertToException, throwExpr.Convert(typeof(object)), Expression.Constant(throwStatementAst.Extent)))); }
public virtual AstVisitAction VisitThrowStatement(ThrowStatementAst throwStatementAst) { return AstVisitAction.Continue; }
public object VisitThrowStatement(ThrowStatementAst throwStatementAst) { // Even if we are in try-catch, we still can safely assume that flow can go to exit from here. // Additional exit point would not affect correctness of analysis: we handle throwing of any statement inside try-body in VisitTryStatement. ControlFlowStatement(throwStatementAst.Pipeline)._throws = true; return null; }
/// <summary/> public virtual object VisitThrowStatement(ThrowStatementAst throwStatementAst) { return(null); }
public override AstVisitAction VisitThrowStatement(ThrowStatementAst throwStatementAst) { this.ReportError(throwStatementAst, () => ParserStrings.FlowControlStatementNotSupportedInDataSection, new object[0]); return AstVisitAction.Continue; }
public object VisitThrowStatement(ThrowStatementAst throwStatementAst) { return false; }
public object VisitThrowStatement(ThrowStatementAst throwStatementAst) { this.ControlFlowStatement(throwStatementAst.Pipeline); return null; }
/// <summary/> public virtual AstVisitAction VisitThrowStatement(ThrowStatementAst throwStatementAst) { return(AstVisitAction.Continue); }
/// <summary> /// Visit throw statement /// </summary> /// <param name="throwStatementAst"></param> /// <returns></returns> public object VisitThrowStatement(ThrowStatementAst throwStatementAst) { if (throwStatementAst == null) return null; ControlFlowStatement(throwStatementAst.Pipeline)._throws = true; return null; }
public object VisitThrowStatement(ThrowStatementAst throwStatementAst) { return(AutomationNull.Value); }
public object VisitThrowStatement(ThrowStatementAst throwStatementAst) { throw new NotImplementedException(); }