lib/ruby2js/converter/block.rb in ruby2js-3.2.0 vs lib/ruby2js/converter/block.rb in ruby2js-3.3.0

- old
+ new

@@ -7,11 +7,11 @@ # (arg :a)) # (lvar :a)) handle :block do |call, args, block| - if + if \ @state == :statement and args.children.length == 1 and call.children.first and call.children.first.type == :begin and call.children[1] == :step and [:irange, :erange].include? call.children.first.children.first.type then @@ -40,10 +40,10 @@ ensure @next_token = next_token @vars = vars if es2015 end - elsif + elsif \ call.children[0] == nil and call.children[1] == :function and call.children[2..-1].all? do |child| child.type == :lvar or (child.type == :send and child.children.length == 2 and child.children[0] == nil and Symbol === child.children[1])