Changeset

13624:de902cc0d46c

util.bitcompat: Avoid potential noise from global metatable If this module is require'd from a plugin on a Lua version without the global bit32 library, it may trip a warning about accessing globals.
author Kim Alvefur <zash@zash.se>
date Wed, 15 Jan 2025 09:55:28 +0100
parents 13623:e226f9632a48
children 13625:ff13dd315e68
files util/bitcompat.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/util/bitcompat.lua	Tue Jan 14 12:26:14 2025 +0000
+++ b/util/bitcompat.lua	Wed Jan 15 09:55:28 2025 +0100
@@ -3,7 +3,7 @@
 -- First try the bit32 lib
 -- Lua 5.3 has it with compat enabled
 -- Lua 5.2 has it by default
-if _G.bit32 then
+if rawget(_G, "bit32") then
 	return _G.bit32;
 end