internal MSAst.Expression Transform(AstGenerator inner, bool needsWrapperMethod, bool needsLocalsDictionary, List<MSAst.Expression> init) { string name = SymbolTable.IdToString(Name); if (_variable.AccessedInNestedScope || needsLocalsDictionary) { ClosureExpression closureVar; if (needsWrapperMethod) { closureVar = inner.LiftedVariable(Variable, name, _variable.AccessedInNestedScope); } else { closureVar = inner.LiftedParameter(Variable, name); } inner.SetLocalLiftedVariable(_variable, closureVar); init.Add(closureVar.Create()); return closureVar; } else { MSAst.Expression parameter; if (needsWrapperMethod) { parameter = inner.Variable(typeof(object), name); } else { parameter = inner.Parameter(typeof(object), name); } inner.Globals.SetParameter(_variable, parameter); return parameter; } }