docs: function decode(encoded, stack) {
      if (!stack) stack = [];
  
      if (encoded === undefined) return undefined;
      if (encoded === null) return null;
  
      var type = typeof(encoded);
  
      if (type === 'boolean') return encoded;
      if (type === 'number') return encoded;
      if (type === 'string') return encoded;
  
      if (type === 'object') {
  
        /* Native transfer of ArrayBuffer(s), views, dates, regular expressions */
        if (isBufferOrView(encoded)) return encoded;
        if (encoded instanceof Date) return encoded;
        if (encoded instanceof RegExp) return encoded;
  
        /* Errors */
        if (encoded["!$error$!"] != null) {
          return new RemoteError(encoded["!$error$!"]);
        }
  
        /* Functions */
        if (encoded["!$function$!"] != null) {
          return eval('(' + encoded["!$function$!"] + ')');
        }
  
        /* Native transfers */
        if (encoded["!$native$!"] != null) {
          return receiveNative(encoded["!$native$!"]);
        }
  
        /* Proxy references */
        if (encoded["!$proxyId$!"] != null) {
          return getProxy(encoded["!$proxyId$!"]);
        }
  
        /* Other (normal) object and arrays */
        return copy(encoded, encoded, stack, decode);
      }
  
      throw new TypeError("Error decoding " + type + ": " + JSON.stringify(encoded));
    }