コード例 #1
0
ファイル: SuperCall.cs プロジェクト: ife/IronLanguages
 internal override MSA.Expression /*!*/ TransformDefinedCondition(AstGenerator /*!*/ gen)
 {
     // MRI doesn't evaluate the arguments
     return(AstUtils.LightDynamic(
                SuperCallAction.Make(gen.Context, RubyCallSignature.IsDefined(true), gen.CurrentFrame.UniqueId),
                typeof(bool),
                gen.CurrentScopeVariable,
                gen.CurrentSelfVariable
                ));
 }
コード例 #2
0
        internal override MSA.Expression TransformDefinedCondition(AstGenerator /*!*/ gen)
        {
            // MRI doesn't evaluate the arguments
            MSA.Expression result = AstUtils.LightDynamic(
                RubyCallAction.Make(gen.Context, _methodName, RubyCallSignature.IsDefined(_target == null)),
                typeof(bool),
                gen.CurrentScopeVariable,
                (_target != null) ? AstUtils.Box(_target.TransformRead(gen)) : gen.CurrentSelfVariable
                );

            return((_target != null) ? gen.TryCatchAny(result, AstFactory.False) : result);
        }