summaryrefslogtreecommitdiffstats
path: root/test/lua/inspect.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/lua/inspect.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/lua/inspect.lua b/test/lua/inspect.lua
index 6b4aff9c..2d967128 100644
--- a/test/lua/inspect.lua
+++ b/test/lua/inspect.lua
@@ -416,7 +416,10 @@ function inspect.marshal(inString, options)
inString = "return " .. inString
end
- local t = assert(loadstring(inString))()
+ -- loadstring was removed after Lua 5.1, load given a string
+ -- argument does the same thing
+ local load = (_VERSION == "Lua 5.1") and loadstring or load
+ local t = assert(load(inString))()
removeIndex(t)