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

Function CallMeta

auxiliary.go:103–111  ·  view source on GitHub ↗

CallMeta calls a metamethod. If the object at index has a metatable and this metatable has a field event, this function calls this field passing the object as its only argument. In this case this function returns true and pushes onto the stack the value returned by the call. If there is no metatabl

(l *State, index int, event string)

Source from the content-addressed store, hash-verified

101// returned by the call. If there is no metatable or no metamethod, this
102// function returns false (without pushing any value on the stack).
103func CallMeta(l *State, index int, event string) bool {
104 index = l.AbsIndex(index)
105 if !MetaField(l, index, event) {
106 return false
107 }
108 l.PushValue(index)
109 l.Call(1, 1)
110 return true
111}
112
113// ArgumentError raises an error with a standard message that includes extraMessage as a comment.
114//

Callers 1

ToStringMetaFunction · 0.85

Calls 4

MetaFieldFunction · 0.85
AbsIndexMethod · 0.80
PushValueMethod · 0.80
CallMethod · 0.80

Tested by

no test coverage detected