Skip to content

Commit d370fdf

Browse files
committed
Pass the source as the second argument in map and filter
1 parent b4a8137 commit d370fdf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/autorun/tinylua.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ end
144144
function INTERNAL:map(input)
145145
local eval = buildParser(input)
146146
return performCall(self, function(results, source, ent)
147-
local rets = pack(eval(ent))
147+
local rets = pack(eval(ent, source))
148148
if #rets ~= 1 then
149149
for _, val in pairs(rets) do
150150
table.insert(results, val)
@@ -158,7 +158,7 @@ end
158158
function INTERNAL:filter(input)
159159
local eval = buildParser(input)
160160
return performCall(self, function(results, source, ent)
161-
if eval(ent) then
161+
if eval(ent, source) then
162162
results[source] = ent
163163
end
164164
end)

0 commit comments

Comments
 (0)