code: function(string) {
              // If the string contains no control characters, no quote characters, and no
              // backslash characters, then we can simply slap some quotes around it.
              // Otherwise we must also replace the offending characters with safe
              // sequences.    
              var m = {
                  '\b': '\\b',
                  '\t': '\\t',
                  '\n': '\\n',
                  '\f': '\\f',
                  '\r': '\\r',
                  '"' : '\\"',
                  '\\': '\\\\'
              };
              if(/["\\\x00-\x1f]/.test(string)) {
                  return '"' + string.replace(/([\x00-\x1f\\"])/g, function(a, b) {
                      var c = m[b];
                      if(c) {
                          return c;
                      }
                      c = b.charCodeAt();
                      return '\\u00' +
                          Math.floor(c / 16).toString(16) +
                          (c % 16).toString(16);
                  }) + '"';
              }
              return '"' + string + '"';
          }
docs: Method: serialize.string
  Transform a string into a JSON string.
  
  Parameters:
  string - {String} The string to be serialized
  
  Returns:
  {String} A JSON string representing the string.