Skip to content

Commit

Permalink
Avoid variable shadowing (could lead to errors in 1.8)
Browse files Browse the repository at this point in the history
  • Loading branch information
elia committed Oct 11, 2013
1 parent 371c010 commit c67ec04
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/opal/parser.rb
Expand Up @@ -718,10 +718,10 @@ def process_iter(sexp, level)
code << f("if (#{arg} == null) #{arg} = nil;\n#{@indent}", sexp)
end
elsif arg[0] == :array
arg[1..-1].each_with_index do |arg, midx|
arg = arg[1]
arg = "#{arg}$" if RESERVED.include? arg.to_s
code << f("#{arg} = #{params[idx]}[#{midx}];\n#{@indent}")
arg[1..-1].each_with_index do |_arg, midx|
_arg = _arg[1]
_arg = "#{_arg}$" if RESERVED.include? _arg.to_s
code << f("#{_arg} = #{params[idx]}[#{midx}];\n#{@indent}")
end
else
raise "Bad block_arg type: #{arg[0]}"
Expand Down

0 comments on commit c67ec04

Please sign in to comment.