TranslateToIL() private method

private TranslateToIL ( ILGenerator il, Type rtype ) : void
il System.Reflection.Emit.ILGenerator
rtype System.Type
return void
        protected override void TranslateToILWithDupOfThisOb(ILGenerator il)
        {
            Call expression = this.expression as Call;

            if ((expression == null) || !expression.inBrackets)
            {
                this.TranslateToILObject(il, null, false);
            }
            else
            {
                if (expression.isConstructor && expression.inBrackets)
                {
                    expression.TranslateToIL(il, Typeob.Object);
                    il.Emit(OpCodes.Dup);
                    return;
                }
                expression.func.TranslateToIL(il, Typeob.Object);
            }
            this.expression.TranslateToIL(il, Typeob.Object);
        }
Example #2
0
        //Called when a late bound call is being made
        protected override void TranslateToILWithDupOfThisOb(ILGenerator il)
        {
            Call c = this.expression as Call;

            if (c == null || !c.inBrackets)
            {
                this.TranslateToILObject(il, null, false);
            }
            else if (c.isConstructor && c.inBrackets)
            {
                //Dealing with (new T[x])[..] or (new T[x])(...), being handled late bound because it is an edge case
                c.TranslateToIL(il, Typeob.Object);
                il.Emit(OpCodes.Dup);
                return;
            }
            else
            {
                c.func.TranslateToIL(il, Typeob.Object);
            }
            this.expression.TranslateToIL(il, Typeob.Object);
        }