docs: @Nullable
    public static String javaScriptEscape (@Nullable final String sInput)
    {
      if (StringHelper.hasNoText (sInput))
        return sInput;
  
      final char [] aInput = sInput.toCharArray ();
      if (!StringHelper.containsAny (aInput, CHARS_TO_MASK))
        return sInput;
  
      final char [] ret = new char [aInput.length * 2];
      int nIndex = 0;
      char cPrevChar = '\u0000';
      for (final char cCurrent : aInput)
      {
        switch (cCurrent)
        {
          case '"':
          case '\'':
          case '\\':
          case '/':
            ret[nIndex++] = MASK_CHAR;
            ret[nIndex++] = cCurrent;
            break;
          case '\t':
            ret[nIndex++] = MASK_CHAR;
            ret[nIndex++] = 't';
            break;
          case '\n':
            if (cPrevChar != '\r')
            {
              ret[nIndex++] = MASK_CHAR;
              ret[nIndex++] = 'n';
            }
            break;
          case '\r':
            ret[nIndex++] = MASK_CHAR;
            ret[nIndex++] = 'n';
            break;
          case '\f':
            ret[nIndex++] = MASK_CHAR;
            ret[nIndex++] = 'f';
            break;
          default:
            ret[nIndex++] = cCurrent;
            break;
        }
        cPrevChar = cCurrent;
      }
  
      return new String (ret, 0, nIndex);
    }