public ExceptionHandlerScope(ExceptionHandlerContainerScope containingScope, ScopeType type, StarkPlatform.Cci.ITypeReference exceptionType) { Debug.Assert((type == ScopeType.Try) || (type == ScopeType.Catch) || (type == ScopeType.Filter) || (type == ScopeType.Finally) || (type == ScopeType.Fault)); Debug.Assert((type == ScopeType.Catch) == (exceptionType != null)); _containingScope = containingScope; _type = type; _exceptionType = exceptionType; }
public override ScopeInfo OpenScope(ScopeType scopeType, StarkPlatform.Cci.ITypeReference exceptionType, ExceptionHandlerScope currentExceptionHandler) { Debug.Assert(((_handlers.Count == 0) && (scopeType == ScopeType.Try)) || ((_handlers.Count > 0) && ((scopeType == ScopeType.Catch) || (scopeType == ScopeType.Filter) || (scopeType == ScopeType.Finally) || (scopeType == ScopeType.Fault)))); Debug.Assert(currentExceptionHandler == _containingHandler); var handler = new ExceptionHandlerScope(this, scopeType, exceptionType); _handlers.Add(handler); return(handler); }
public virtual ScopeInfo OpenScope(ScopeType scopeType, StarkPlatform.Cci.ITypeReference exceptionType, ExceptionHandlerScope currentHandler) { if (scopeType == ScopeType.TryCatchFinally) { return(new ExceptionHandlerContainerScope(currentHandler)); } else { Debug.Assert(scopeType == ScopeType.Variable || scopeType == ScopeType.StateMachineVariable); return(new LocalScopeInfo()); } }