code: function escapeValue(str)
  {
    var cur = 0;
    var len = str.length;
    var out = '';
  
    while (cur < len) {
      var c = str[cur];
  
      switch (c) {
      case '(':
        /*
         * Although '*' characters should be escaped too, we ignore them here in
         * case downstream ExtensibleFilter consumers wish to perform their own
         * value-add parsing after the fact.
         *
         * Handling unescaped ')' is not needed since such occurances will parse
         * as premature (and likely) unbalanced parens in the filter expression.
         */
        throw new Error('illegal unescaped char: ' + c);
  
      case '\\':
        /* Parse a \XX hex escape value */
        var val = str.substr(cur + 1, 2);
        if (val.match(hexRegex) === null) {
          throw new Error('invalid escaped char');
        }
        out += String.fromCharCode(parseInt(val, 16));
        cur += 3;
        break;
  
      default:
        /* Add one regular char */
        out += c;
        cur++;
        break;
      }
    }
  
    return out;
  }
docs: /--- Internal