Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetTop() is incorrect after SkipOpenLibs #416

Open
592530326 opened this issue Nov 21, 2022 · 0 comments
Open

GetTop() is incorrect after SkipOpenLibs #416

592530326 opened this issue Nov 21, 2022 · 0 comments

Comments

@592530326
Copy link

L := lua.NewState(lua.Options{SkipOpenLibs: true, CallStackSize: 256, RegistrySize: 256 * 20})
lua.OpenBase(L)
lua.OpenString(L)
lua.OpenTable(L)
lua.OpenMath(L)
defer L.Close()
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(timeout)*time.Second)
defer cancel()
L.SetContext(ctx)
if err := L.DoString(`
function a(c,v)
	--io.open()
	--print(_G)
	return c+v
end
local ccc ={}
ccc["1123"] = 123456
print(ccc)
`); err != nil {
	return "", err
}
value := L.GetTop()
fmt.Println("GetTop", value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant