Skip to content

Commit 52cdb5e

Browse files
committedNov 3, 2013
Generate block_pass/iter after assinging temp variables to avoid variable overlap
1 parent cf40b98 commit 52cdb5e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎lib/opal/nodes/call.rb

+5-2
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,17 @@ def compile
2929
splat = arglist[1..-1].any? { |a| a.first == :splat }
3030

3131
if Sexp === arglist.last and arglist.last.type == :block_pass
32-
block = expr(arglist.pop)
32+
block = arglist.pop
3333
elsif iter
34-
block = expr(iter)
34+
block = iter
3535
end
3636

3737
tmpfunc = scope.new_temp if block
3838
tmprecv = scope.new_temp if splat || tmpfunc
3939

40+
# must do this after assigning temp variables
41+
block = expr(block) if block
42+
4043
recv_code = recv(recv_sexp)
4144
call_recv = s(:js_tmp, tmprecv || recv_code)
4245

0 commit comments

Comments
 (0)
Please sign in to comment.