lua: add recursive read-only bindings for borrowed slices

This commit is contained in:
Meo597
2026-10-15 06:36:12 +08:00
parent ef4f4888df
commit b408f7f0c7
5 changed files with 187 additions and 3 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ func (r *Router) RegisterLua(L *lua.LState) {
}
func registerLuaContext(L *lua.LState) {
pushIPs := xlua.NewSlicePusher[net.IP](L)
pushIPs := xlua.NewReadOnlySlicePusher[net.IP](L)
attributes := L.NewTypeMetatable(luaAttributesType)
L.SetField(attributes, "__index", L.NewFunction(func(L *lua.LState) int {
values := L.CheckUserData(1).Value.(map[string]string)