提交 c0cedbd1 编写于 作者: J Justin Collins

Remove special cased OutputProcessor#process_call

There should never be the case where the target of a :call Sexp is a
symbol, it should always be either `nil` or a Sexp. Brakeman should not
be building invalid Sexps.
上级 ef8ea3ff
......@@ -23,36 +23,6 @@ class Brakeman::OutputProcessor < Ruby2Ruby
end
end
def process_call exp
if exp[0].is_a? Symbol
target = exp[0]
method = exp[1]
args = process exp[2]
out = nil
if method == :[]
if target
out = "#{target}[#{args}]"
else
raise Exception.new("Not sure what to do with access and no target: #{exp}")
end
else
if target
out = "#{target}.#{method}(#{args})"
else
out = "#{method}(#{args})"
end
end
exp.clear
out
else
super exp
end
end
def process_lvar exp
out = "(local #{exp[0]})"
exp.clear
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册