]> git.lizzy.rs Git - minetest.git/commitdiff
Always set globals in __newindex (#13131)
authorJude Melton-Houghton <jwmhjwmh@gmail.com>
Mon, 9 Jan 2023 20:00:49 +0000 (15:00 -0500)
committerGitHub <noreply@github.com>
Mon, 9 Jan 2023 20:00:49 +0000 (15:00 -0500)
builtin/common/strict.lua

index 6a385fa803fb2eaa10a8eb7353b2c8941c893e96..9bfa8d7a2105d70fe6ab91dde23094c021d76065 100644 (file)
@@ -14,6 +14,7 @@ local declared = {}
 local warned = {}
 
 function meta:__newindex(name, value)
+       rawset(self, name, value)
        if declared[name] then
                return
        end
@@ -25,7 +26,6 @@ function meta:__newindex(name, value)
                                :format(name, desc))
                warned[warn_key] = true
        end
-       rawset(self, name, value)
        declared[name] = true
 end