fix bug in JS compiler