Lua: Expose Go slices as read-only

This commit is contained in:
Meo597
2026-11-20 05:16:13 +08:00
parent 02cf0f60ea
commit 84ce7568bb
5 changed files with 30 additions and 52 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ func RegisterLua(L *lua.LState) {
return 0
}
xlua.PushWithDirectMethods(L, matcher, map[string]xlua.DirectMethod{
"Match": newLuaDomainMatch(xlua.NewSlicePusher[uint32](L)),
"Match": newLuaDomainMatch(xlua.NewReadOnlySlicePusher[uint32](L)),
"MatchAny": luaDomainMatchAny,
})
return 1