src/js/lib/RTRemoteProtocol.js
/**
   * inject protocol into message that message contains rtValues(RTObject type)
   *
   * @param message the remote message
   */
inject protocol into message that message contains rtValues(RTObject type)
@param message the remote message
inject protocol into message that message contains rtValues ( RTObject type ) @param message the remote message
injectProtocolToMessageObjectValue(message) {
    const injectProtocol = (rv) => {
      if (rv && rv.value instanceof RTRemoteObject) {
        rv.value.protocol = this;
      }
    };
    const type = message[RTConst.MESSAGE_TYPE];
    if (type === RTRemoteMessageType.GET_PROPERTY_BYINDEX_RESPONSE
      || type === RTRemoteMessageType.GET_PROPERTY_BYNAME_RESPONSE
    ) {
      injectProtocol(message[RTConst.VALUE]);
    } else if (type === RTRemoteMessageType.METHOD_CALL_REQUEST) {
      const args = message[RTConst.FUNCTION_ARGS];
      if (args && args.length > 0) {
        args.forEach(arg => injectProtocol(arg));
      }
    } else if (type === RTRemoteMessageType.METHOD_CALL_RESPONSE) {
      const args = message[RTConst.FUNCTION_RETURN_VALUE];
      if (args && Object.keys(args).length > 0) {
        injectProtocol(args);
      }
    }
  }
injectProtocolToMessageObjectValue ( message ) { const injectProtocol = ( rv ) => { if ( rv && rv . value instanceof RTRemoteObject ) { rv . value . protocol = this ; } } ; const type = message [ RTConst . MESSAGE_TYPE ] ; if ( type === RTRemoteMessageType . GET_PROPERTY_BYINDEX_RESPONSE || type === RTRemoteMessageType . GET_PROPERTY_BYNAME_RESPONSE ) { injectProtocol ( message [ RTConst . VALUE ] ) ; } else if ( type === RTRemoteMessageType . METHOD_CALL_REQUEST ) { const args = message [ RTConst . FUNCTION_ARGS ] ; if ( args && args . length > 0 ) { args . forEach ( arg => injectProtocol ( arg ) ) ; } } else if ( type === RTRemoteMessageType . METHOD_CALL_RESPONSE ) { const args = message [ RTConst . FUNCTION_RETURN_VALUE ] ; if ( args && Object . keys ( args ) . length > 0 ) { injectProtocol ( args ) ; } } }
inject protocol into message that message contains rtValues(RTObject type)
 @param message the remote message
inject protocol into message that message contains rtValues ( RTObject type ) @param message the remote message