lib/ruby2js/converter/block.rb in ruby2js-3.0.11 vs lib/ruby2js/converter/block.rb in ruby2js-3.0.12
- old
+ new
@@ -26,14 +26,14 @@
put "for (#{es2015 ? 'let' : 'var'} ";
parse var; put " = "; parse expression.children.first
put "; "; parse var;
if call.children[2].type == :int and call.children[2].children[0] < 0
put " #{comp.sub('<', '>')} "; parse expression.children.last
- put "; "; parse var; put " -= "
- parse s(:int, -call.children[2].children[0])
+ put "; "; parse s(:op_asgn, var, :-,
+ s(:int, -call.children[2].children[0])), :statement
else
put " #{comp} "; parse expression.children.last
- put "; "; parse var; put " += "; parse call.children[2]
+ put "; "; parse s(:op_asgn, var, :+, call.children[2]), :statement
end
puts ") {"
scope block
sput "}"
ensure