mirror of https://github.com/Hilbis/Hilbish
fix: use load from source in DoFile function instead of load chunk
parent
d4084a82ba
commit
7a17d7931f
|
@ -93,9 +93,9 @@ func DoFile(rtm *rt.Runtime, path string) error {
|
||||||
buf = append(buf, line...)
|
buf = append(buf, line...)
|
||||||
}
|
}
|
||||||
|
|
||||||
chunk, err := rtm.CompileAndLoadLuaChunk(path, buf, rt.TableValue(rtm.GlobalEnv()))
|
clos, err := rtm.LoadFromSourceOrCode(path, buf, "bt", rt.TableValue(rtm.GlobalEnv()), false)
|
||||||
if chunk != nil {
|
if clos != nil {
|
||||||
_, err = rt.Call1(rtm.MainThread(), rt.FunctionValue(chunk))
|
_, err = rt.Call1(rtm.MainThread(), rt.FunctionValue(clos))
|
||||||
}
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue