added a helper function: Utils::validateJSMethodName().