mirror of https://github.com/Hilbis/Hilbish
refactor: make loader functions for go modules unexported
parent
a45b3fe1fa
commit
c46807613e
|
@ -24,14 +24,14 @@ func New() Bait {
|
||||||
Em: emitter,
|
Em: emitter,
|
||||||
}
|
}
|
||||||
b.Loader = packagelib.Loader{
|
b.Loader = packagelib.Loader{
|
||||||
Load: b.LoaderFunc,
|
Load: b.loaderFunc,
|
||||||
Name: "bait",
|
Name: "bait",
|
||||||
}
|
}
|
||||||
|
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *Bait) LoaderFunc(rtm *rt.Runtime) (rt.Value, func()) {
|
func (b *Bait) loaderFunc(rtm *rt.Runtime) (rt.Value, func()) {
|
||||||
exports := map[string]util.LuaExport{
|
exports := map[string]util.LuaExport{
|
||||||
"catch": util.LuaExport{b.bcatch, 2, false},
|
"catch": util.LuaExport{b.bcatch, 2, false},
|
||||||
"catchOnce": util.LuaExport{b.bcatchOnce, 2, false},
|
"catchOnce": util.LuaExport{b.bcatchOnce, 2, false},
|
||||||
|
|
|
@ -18,14 +18,14 @@ func New() Commander {
|
||||||
Events: emission.NewEmitter(),
|
Events: emission.NewEmitter(),
|
||||||
}
|
}
|
||||||
c.Loader = packagelib.Loader{
|
c.Loader = packagelib.Loader{
|
||||||
Load: c.LoaderFunc,
|
Load: c.loaderFunc,
|
||||||
Name: "commander",
|
Name: "commander",
|
||||||
}
|
}
|
||||||
|
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Commander) LoaderFunc(rtm *rt.Runtime) (rt.Value, func()) {
|
func (c *Commander) loaderFunc(rtm *rt.Runtime) (rt.Value, func()) {
|
||||||
exports := map[string]util.LuaExport{
|
exports := map[string]util.LuaExport{
|
||||||
"register": util.LuaExport{c.cregister, 2, false},
|
"register": util.LuaExport{c.cregister, 2, false},
|
||||||
"deregister": util.LuaExport{c.cderegister, 1, false},
|
"deregister": util.LuaExport{c.cderegister, 1, false},
|
||||||
|
|
|
@ -12,11 +12,11 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var Loader = packagelib.Loader{
|
var Loader = packagelib.Loader{
|
||||||
Load: LoaderFunc,
|
Load: loaderFunc,
|
||||||
Name: "fs",
|
Name: "fs",
|
||||||
}
|
}
|
||||||
|
|
||||||
func LoaderFunc(rtm *rt.Runtime) (rt.Value, func()) {
|
func loaderFunc(rtm *rt.Runtime) (rt.Value, func()) {
|
||||||
exports := map[string]util.LuaExport{
|
exports := map[string]util.LuaExport{
|
||||||
"cd": util.LuaExport{fcd, 1, false},
|
"cd": util.LuaExport{fcd, 1, false},
|
||||||
"mkdir": util.LuaExport{fmkdir, 2, false},
|
"mkdir": util.LuaExport{fmkdir, 2, false},
|
||||||
|
|
Loading…
Reference in New Issue