From 1c21b570a3a667b94a1aa5455591c398239c8d94 Mon Sep 17 00:00:00 2001 From: badiku <30396109+badiku@users.noreply.github.com> Date: Sun, 11 Feb 2024 16:18:34 +0800 Subject: [PATCH] avoid conflicting with strict mode. fix #152 --- luaunit.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luaunit.lua b/luaunit.lua index 4741478b..603e94ea 100755 --- a/luaunit.lua +++ b/luaunit.lua @@ -18,7 +18,7 @@ M.VERSION='3.4' M._VERSION=M.VERSION -- For LuaUnit v2 compatibility -- a version which distinguish between regular Lua and LuaJit -M._LUAVERSION = (jit and jit.version) or _VERSION +M._LUAVERSION = rawget(_ENV, 'jit') and jit.version or _VERSION --[[ Some people like assertEquals( actual, expected ) and some people prefer assertEquals( expected, actual ). @@ -63,7 +63,7 @@ M.FORCE_DEEP_ANALYSIS = true M.DISABLE_DEEP_ANALYSIS = false -- set EXPORT_ASSERT_TO_GLOBALS to have all asserts visible as global values --- EXPORT_ASSERT_TO_GLOBALS = true +local EXPORT_ASSERT_TO_GLOBALS = rawget(_ENV, 'EXPORT_ASSERT_TO_GLOBALS') and EXPORT_ASSERT_TO_GLOBALS -- we need to keep a copy of the script args before it is overriden local cmdline_argv = rawget(_G, "arg")