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

Method metaTable

lua.go:256–282  ·  view source on GitHub ↗
(o value)

Source from the content-addressed store, hash-verified

254}
255
256func (g *globalState) metaTable(o value) *table {
257 var t Type
258 switch o.(type) {
259 case nil:
260 t = TypeNil
261 case bool:
262 t = TypeBoolean
263 // TODO TypeLightUserData
264 case float64:
265 t = TypeNumber
266 case string:
267 t = TypeString
268 case *table:
269 t = TypeTable
270 case *goFunction:
271 t = TypeFunction
272 case closure:
273 t = TypeFunction
274 case *userData:
275 t = TypeUserData
276 case *State:
277 t = TypeThread
278 default:
279 return nil
280 }
281 return g.metaTables[t]
282}
283
284func (l *State) adjustResults(resultCount int) {
285 if resultCount == MultipleReturns && l.callInfo.top < l.top {

Callers 2

MetaTableMethod · 0.80
tagMethodByObjectMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected