Lua: use of loadstring replaced with load; loadstring is deprecated. (#4275)

This commit is contained in:
tarsJr 2021-11-29 03:19:16 +05:30 committed by GitHub
parent 3aa763520b
commit 57fe664a50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -383,8 +383,9 @@ dofile('mod2.lua') --> Hi! (runs it again)
-- loadfile loads a lua file but doesn't run it yet. -- loadfile loads a lua file but doesn't run it yet.
f = loadfile('mod2.lua') -- Call f() to run it. f = loadfile('mod2.lua') -- Call f() to run it.
-- loadstring is loadfile for strings. -- load is loadfile for strings.
g = loadstring('print(343)') -- Returns a function. -- (loadstring is deprecated, use load instead)
g = load('print(343)') -- Returns a function.
g() -- Prints out 343; nothing printed before now. g() -- Prints out 343; nothing printed before now.
--]] --]]