2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-04-21 04:53:24 +00:00

docs(golibs/bait): add docs for lua release function

This commit is contained in:
TorchedSammy 2022-08-16 13:41:46 -04:00
parent f2b68fe926
commit c55bf4a736
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD

View File

@ -275,6 +275,10 @@ func (b *Bait) bcatchOnce(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
return c.Next(), nil return c.Next(), nil
} }
// release(name, catcher)
// Removes the `catcher` for the event with `name`
// For this to work, `catcher` has to be the same function used to catch
// an event, like one saved to a variable.
func (b *Bait) brelease(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) { func (b *Bait) brelease(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
name, catcher, err := util.HandleStrCallback(t, c) name, catcher, err := util.HandleStrCallback(t, c)
if err != nil { if err != nil {