MCPcopy Index your code
hub / github.com/yuin/gopher-lua / CloseUpvalues

Method CloseUpvalues

compile.go:578–585  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

576}
577
578func (fc *funcContext) CloseUpvalues() int {
579 n := -1
580 if fc.Block.RefUpvalue {
581 n = fc.Block.Parent.LocalVars.LastIndex()
582 fc.Code.AddABC(OP_CLOSE, n, 0, 0, fc.Block.LastLine)
583 }
584 return n
585}
586
587func (fc *funcContext) LeaveBlock() int {
588 closed := fc.CloseUpvalues()

Callers 2

LeaveBlockMethod · 0.95
compileWhileStmtFunction · 0.80

Calls 2

LastIndexMethod · 0.80
AddABCMethod · 0.80

Tested by

no test coverage detected