Skip to content

Commit 6a6278c

Browse files
committed
Merge branch 'upsteam'
2 parents c1f06de + 055d46f commit 6a6278c

File tree

5 files changed

+34
-22
lines changed

5 files changed

+34
-22
lines changed

extension/script/backend/worker/eval/readonly.lua

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
local source, level, symbol = ...
22
level = (level or 0) + 2
33

4+
local _load
5+
local _unpack
46
if _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
1212
end
1313

1414
local f = assert(debug.getinfo(level,"f").func, "can't find function")
@@ -74,8 +74,8 @@ end]]):gsub("%$(%w+)", {
7474
})
7575
end
7676
local 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)'))
7979
local func = compiled()
8080
do
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))
107107
else
108108
return func()
109109
end

extension/script/backend/worker/eval/readwrite.lua

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
local source, level = ...
22
level = (level or 0) + 2
33

4+
local _load
5+
local _pack
6+
local _unpack
47
if _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
1219
end
1320

1421
local f = assert(debug.getinfo(level,"f").func, "can't find function")
@@ -81,8 +88,8 @@ end
8188
end
8289

8390
local 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)'))
8693
local func, update = compiled()
8794
local found = {}
8895
do
@@ -114,9 +121,9 @@ do
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
121128
end
122129
for _, info in ipairs(update()) do
@@ -128,4 +135,4 @@ for _, info in ipairs(update()) do
128135
end
129136
end
130137
end
131-
return table.unpack(rets)
138+
return _unpack(rets)
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
local source = ...
2+
3+
local _load
24
if _VERSION == "Lua 5.1" then
3-
load = loadstring
5+
_load = loadstring
6+
else
7+
_load = load
48
end
5-
assert(load("return " .. source, '=(EVAL)'))
9+
10+
assert(_load("return " .. source, '=(EVAL)'))

src/luadebug/symbolize/symbolize_linux.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace luadebug {
4040
args.push(*p);
4141
}
4242
spawn.redirect(bee::subprocess::stdio::eOutput, pipe.wr);
43-
if (!spawn.exec(args, nullptr)) {
43+
if (!spawn.exec(args, {})) {
4444
return std::nullopt;
4545
}
4646
std::string res;

src/luadebug/symbolize/symbolize_macos.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace luadebug {
4040
args.push(*p);
4141
}
4242
spawn.redirect(bee::subprocess::stdio::eOutput, pipe.wr);
43-
if (!spawn.exec(args, nullptr)) {
43+
if (!spawn.exec(args, {})) {
4444
return std::nullopt;
4545
}
4646
std::string res;

0 commit comments

Comments
 (0)