File tree Expand file tree Collapse file tree 3 files changed +32
-20
lines changed
extension/script/backend/worker/eval Expand file tree Collapse file tree 3 files changed +32
-20
lines changed Original file line number Diff line number Diff line change 11local source , level , symbol = ...
22level = (level or 0 ) + 2
33
4+ local _load
5+ local _unpack
46if _VERSION == " Lua 5.1" then
5- load = loadstring
6- function table .pack (...)
7- local t = {... }
8- t .n = select (" #" , ... )
9- return t
10- end
11- table .unpack = unpack
7+ _load = loadstring
8+ _unpack = unpack
9+ else
10+ _load = load
11+ _unpack = table.unpack
1212end
1313
1414local f = assert (debug.getinfo (level ," f" ).func , " can't find function" )
@@ -74,8 +74,8 @@ end]]):gsub("%$(%w+)", {
7474})
7575end
7676local compiled = env
77- and assert (load (full_source , ' =(EVAL)' , " t" , env ))
78- or assert (load (full_source , ' =(EVAL)' ))
77+ and assert (_load (full_source , ' =(EVAL)' , " t" , env ))
78+ or assert (_load (full_source , ' =(EVAL)' ))
7979local func = compiled ()
8080do
8181 local i = 1
@@ -103,7 +103,7 @@ if vararg then
103103 end
104104 i = i + 1
105105 end
106- return func (table.unpack (vargs ))
106+ return func (_unpack (vargs ))
107107else
108108 return func ()
109109end
Original file line number Diff line number Diff line change 11local source , level = ...
22level = (level or 0 ) + 2
33
4+ local _load
5+ local _pack
6+ local _unpack
47if _VERSION == " Lua 5.1" then
5- load = loadstring
6- function table . pack (...)
8+ _load = loadstring
9+ _pack = function (...)
710 local t = {... }
811 t .n = select (" #" , ... )
912 return t
1013 end
11- table .unpack = unpack
14+ _unpack = unpack
15+ else
16+ _load = load
17+ _pack = table.pack
18+ _unpack = table.unpack
1219end
1320
1421local f = assert (debug.getinfo (level ," f" ).func , " can't find function" )
8188end
8289
8390local compiled = env
84- and assert (load (full_source , ' =(EVAL)' , " t" , env ))
85- or assert (load (full_source , ' =(EVAL)' ))
91+ and assert (_load (full_source , ' =(EVAL)' , " t" , env ))
92+ or assert (_load (full_source , ' =(EVAL)' ))
8693local func , update = compiled ()
8794local found = {}
8895do
114121 end
115122 i = i + 1
116123 end
117- rets = table.pack (func (table.unpack (vargs )))
124+ rets = _pack (func (_unpack (vargs )))
118125 else
119- rets = table.pack (func ())
126+ rets = _pack (func ())
120127 end
121128end
122129for _ , info in ipairs (update ()) do
@@ -128,4 +135,4 @@ for _, info in ipairs(update()) do
128135 end
129136 end
130137end
131- return table.unpack (rets )
138+ return _unpack (rets )
Original file line number Diff line number Diff line change 11local source = ...
2+
3+ local _load
24if _VERSION == " Lua 5.1" then
3- load = loadstring
5+ _load = loadstring
6+ else
7+ _load = load
48end
5- assert (load (" return " .. source , ' =(EVAL)' ))
9+
10+ assert (_load (" return " .. source , ' =(EVAL)' ))
You can’t perform that action at this time.
0 commit comments