javascript function definition parser