merge var and assign when generating javascript code

for better format, merge var and assign when generating javascript code
fix a bug in varInitList: new line after indented var init should be accepts, but if not indent, new line should be rejected.