lib/to_source/visitor.rb in to_source-0.2.6 vs lib/to_source/visitor.rb in to_source-0.2.7

- old
+ new

@@ -887,10 +887,13 @@ # # @api private # def z_super(node) emit('super') + if node.block + dispatch(node.block) + end end # Emit super # # @param [Rubinius::AST::Node] node @@ -898,16 +901,15 @@ # @return [undefined] # # @api private # def super(node) - z_super(node) + emit('super') # Stupid hack to ensure super() is emitted, this lib needs a redesign! arguments = node.arguments - empty = arguments.array.empty? && !arguments.splat && !node.block.kind_of?(Rubinius::AST::BlockPass19) - emit('(') if empty + empty = arguments.array.empty? && !arguments.splat && !node.block + emit('()') if empty arguments(node) - emit(')') if empty end # Emit concat args # # @param [Rubinius::AST::Node] node