Skip to content
Snippets Groups Projects
Commit 5e36d234 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

Implement dostring() function in box.lua.

parent cbf842d6
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,14 @@ function box.select_limit(space, index, offset, limit, ...)
...))
end
function box.dostring(s, ...)
local chunk, message = loadstring(s)
if chunk == nil then
error(message, 2)
end
return chunk(...)
end
--
--
--
......
No preview for this file type
......@@ -526,3 +526,11 @@ exec admin "lua box.counter.dec(0, 1)"
exec admin "lua box.select(0, 0, 1)"
exec admin "lua box.counter.dec(0, 1)"
exec admin "lua box.select(0, 0, 1)"
print """# box.dostring()"""
exec admin "lua box.dostring('abc')"
exec admin "lua box.dostring('abc=2')"
exec admin "lua box.dostring('return abc')"
exec admin "lua box.dostring('return ...', 1, 2, 3)"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment