code: function writeValue(rh, value, to) {
              if (typeof to === "undefined") { to = ''; }
              shared.utils.dassert(shared.utils.isObject(rh));
              var type = shared.utils.treatAs(value);
              switch(type) {
                  case 'null':
                      to += 'null';
                      break;
                  case 'undefined':
                      to += 'undefined';
                      break;
                  case 'number':
                  case 'Number':
                  case 'boolean':
                  case 'Boolean':
                      to += value.toString();
                      break;
                  case 'string':
                  case 'String':
                      to += JSON.stringify(value);
                      break;
                  case 'Date':
                      to += JSON.stringify(value.toString());
                      break;
                  case 'Object':
                  case 'Array':
                      to += '<' + rh.valueId(value) + '>';
                      break;
                  case 'function':
                  case 'RegExp':
                  case 'Error':
                      to += 'null';
                      break;
                  default:
                      shared.utils.defaultLogger().fatal('Unexpected type: %s', type);
                      break;
              }
              return to;
          }
docs: /*
  Append serialized form of a value onto the supplied string.
  Object/Array values are serialised by reference, see writeObject() for
  full serialisation of object/array properties. Returns the passed string.