public void Visit(UpValRef e) { // The block where the upval was declared needs to be closed. for (BlockBuilder outer = block; outer != null; outer = outer.Parent) { if (outer.Block == e.Variable.Block) { outer.SetNeedsClose(); break; } } // Get upval. function.InstructionABC(e.SourceSpan, Opcode.GetUpVal, target, function.UpVal(e.Variable), 0); }