private void EmitClosureAccess(LambdaCompiler lc, HoistedLocals locals) { if (locals != null) { this.EmitClosureToVariable(lc, locals); while ((locals = locals.Parent) != null) { ParameterExpression selfVariable = locals.SelfVariable; LocalStorage storage = new LocalStorage(lc, selfVariable); storage.EmitStore(this.ResolveVariable(selfVariable)); this._locals.Add(selfVariable, storage); } } }
// Creates IL locals for accessing closures private void EmitClosureAccess(LambdaCompiler lc, HoistedLocals?locals) { if (locals == null) { return; } EmitClosureToVariable(lc, locals); while ((locals = locals.Parent) != null) { ParameterExpression v = locals.SelfVariable; var local = new LocalStorage(lc, v); local.EmitStore(ResolveVariable(v)); _locals.Add(v, local); } }
// Creates IL locals for accessing closures private void EmitClosureAccess(LambdaCompiler lc, HoistedLocals locals) { if (locals == null) { return; } EmitClosureToVariable(lc, locals); while ((locals = locals.Parent) != null) { ParameterExpression v = locals.SelfVariable; var local = new LocalStorage(lc, v); local.EmitStore(ResolveVariable(v)); _locals.Add(v, local); } }