Fix parameters order in JavaScript generation.