fix bug related to arrays in JS compiler