Pass `nameIsLongname` function via RegExp.escape

Member function containing regular expression tokens causes jsDoc to break. Passing them via `RegExp.escape` causes these tokens to get escaped and hence generate a valid regular expression.