internal override void Emit(EmitContext ec) { TypeManager.BeginScope(); ILGenerator old_ig = ec.ig; ec.ig = this.ig; ((ICanModifyContext)func_obj.body).EmitDecls(ec); func_obj.body.Emit(ec); string func_name = func_obj.name; if (SemanticAnalyser.MethodContainsEval(func_name)) { CodeGenerator.load_local_vars(ec.ig, true); } else { VariableDeclaration decl = SemanticAnalyser.OutterScopeVar(func_name); if (decl == null) { decl = SemanticAnalyser.VarUsedNested(func_name); if (decl != null) { CodeGenerator.load_local_vars(ec.ig, InFunction); } } else { CodeGenerator.locals_to_stack_frame(ec.ig, decl.lexical_depth, lexical_depth - decl.lexical_depth, true); } } this.ig.Emit(OpCodes.Ret); ec.ig = old_ig; TypeManager.EndScope(); }