Skip to content

Commit

Permalink
Remove previous bug-fix for splatting.
Browse files Browse the repository at this point in the history
This is currently causing to emit `Opal.to_a(Opal.to_a(..))` for splats,
since the issue was then fixed downstream in the splat node handler.
meh committed Aug 13, 2015

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent f052ec1 commit e9237be
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/opal/nodes/arglist.rb
Original file line number Diff line number Diff line change
@@ -16,9 +16,9 @@ def compile
if splat
if work.empty?
if code.empty?
code << fragment("Opal.to_a(") << arg << fragment(")")
code << arg
else
code << fragment(".concat(Opal.to_a(") << arg << fragment("))")
code << fragment(".concat(") << arg << fragment(")")
end
else
if code.empty?
@@ -27,7 +27,7 @@ def compile
code << fragment(".concat([") << work << fragment("])")
end

code << fragment(".concat(Opal.to_a(") << arg << fragment("))")
code << fragment(".concat(") << arg << fragment(")")
end

work = []
@@ -43,7 +43,7 @@ def compile
if code.empty?
code = join
else
code << fragment(".concat(Opal.to_a(") << join << fragment("))")
code << fragment(".concat(") << join << fragment(")")
end
end

0 comments on commit e9237be

Please sign in to comment.