MCPcopy Index your code
hub / github.com/Shopify/go-lua / SingleVariable

Method SingleVariable

code.go:1068–1076  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

1066}
1067
1068func (f *function) SingleVariable(name string) (e exprDesc) {
1069 var found bool
1070 if e, found = singleVariableHelper(f, name, true); !found {
1071 e, found = singleVariableHelper(f, "_ENV", true)
1072 f.assert(found && (e.kind == kindLocal || e.kind == kindUpValue))
1073 e = f.Indexed(e, f.EncodeString(name))
1074 }
1075 return
1076}
1077
1078func (f *function) OpenConstructor() (pc int, t exprDesc) {
1079 pc = f.EncodeABC(opNewTable, 0, 0, 0)

Callers 1

singleVariableMethod · 0.80

Calls 4

assertMethod · 0.95
IndexedMethod · 0.95
EncodeStringMethod · 0.95
singleVariableHelperFunction · 0.85

Tested by

no test coverage detected