protected CallSiteBinder GetLightBinder() { ILightExceptionBinder binder = _binder as ILightExceptionBinder; if (binder != null) { return(binder.GetLightExceptionBinder()); } return(_binder); }
/// <summary> /// Returns true if the call site binder is a light exception binder and supports /// light throws. Returns false otherwise. /// </summary> /// <param name="binder"></param> /// <returns></returns> public static bool SupportsLightThrow(this CallSiteBinder binder) { ILightExceptionBinder lightBinder = binder as ILightExceptionBinder; if (lightBinder != null) { return(lightBinder.SupportsLightThrow); } return(false); }
Expression ILightExceptionAwareExpression.ReduceForLightExceptions() { ILightExceptionBinder binder = Binder as ILightExceptionBinder; if (binder != null) { var lightBinder = binder.GetLightExceptionBinder() as DynamicMetaObjectBinder; if (lightBinder != binder) { return(DynamicExpression.Dynamic( lightBinder, Type, Args)); } } return(this); }