Microsoft.JScript.FunctionObject.TranslateToILToCopyLocalsFromNestedScope C# (CSharp) Method

TranslateToILToCopyLocalsFromNestedScope() private method

private TranslateToILToCopyLocalsFromNestedScope ( ILGenerator il, FunctionScope nestedScope ) : void
il ILGenerator
nestedScope FunctionScope
return void
      private void TranslateToILToCopyLocalsFromNestedScope(ILGenerator il, FunctionScope nestedScope){
        int offset = (this.attributes&MethodAttributes.Static) == MethodAttributes.Static ? 0 : 1;
        int n = this.fields.Length;
        for (int i = 0; i < n; i++){
          JSLocalField field = nestedScope.GetOuterLocalField(this.fields[i].Name);
          if (field == null || field.outerField != this.fields[i])
            continue;
          il.Emit(OpCodes.Dup);
          ConstantWrapper.TranslateToILInt(il, this.fields[i].slotNumber);
          il.Emit(OpCodes.Ldloc, (LocalBuilder)field.metaData);
          Convert.Emit(this.body, il, this.fields[i].FieldType, Typeob.Object);
          il.Emit(OpCodes.Stelem_Ref);
        }
        il.Emit(OpCodes.Pop);
      }
    }