javascript: Fix functino name generation