Replacing the Loadstring Function in the Latest Version

I upgraded from lua 5.1 to 5.3.2. One of my scripts did not work due to attempt to call a nil value (global 'loadstring')So, did they replace it with a new function?

Here you can find the function https://www.lua.org/pil/8.html
There you can test it (will not work) http://www.lua.org/cgi-bin/demo

+4
source share
1 answer

Since Lua 5.2, has loadstringbeen replaced by load.

From the Lua 5.2 Reference Guide :

Function is loadstringdeprecated. Use load; instead ; now it takes string arguments and is exactly equivalent loadstring.

+8
source

All Articles