Microsoft.JScript.Eval.TranslateToIL C# (CSharp) Method

TranslateToIL() private method

private TranslateToIL ( ILGenerator il, Type rtype ) : void
il ILGenerator
rtype System.Type
return void
      internal override void TranslateToIL(ILGenerator il, Type rtype){
        if (this.enclosingFunctionScope != null && this.enclosingFunctionScope.owner != null)
          this.enclosingFunctionScope.owner.TranslateToILToSaveLocals(il);
        this.operand.TranslateToIL(il, Typeob.Object);
        MethodInfo evaluateMethod = null;
        ConstantWrapper cw = this.unsafeOption as ConstantWrapper;
        if (cw != null){
          string s = cw.value as string;
          if (s != null && s == "unsafe")
            evaluateMethod = CompilerGlobals.jScriptEvaluateMethod1;
        }
        if (evaluateMethod == null){
          evaluateMethod = CompilerGlobals.jScriptEvaluateMethod2;
          if (this.unsafeOption == null)
            il.Emit(OpCodes.Ldnull);
          else
            this.unsafeOption.TranslateToIL(il, Typeob.Object);
        }
        this.EmitILToLoadEngine(il);
        il.Emit(OpCodes.Call, evaluateMethod);
        Convert.Emit(this, il, Typeob.Object, rtype);
        if (this.enclosingFunctionScope != null && this.enclosingFunctionScope.owner != null)
          this.enclosingFunctionScope.owner.TranslateToILToRestoreLocals(il);
      }