Flotype / now

NowJS makes it easy to build real-time web apps using JavaScript
http://www.nowjs.com
MIT License
1.91k stars 175 forks source link

message handler passes message by reference #102

Closed AD7six closed 13 years ago

AD7six commented 13 years ago

This may be a misunderstanding on my part but

https://github.com/Flotype/now/blob/master/lib/now.js#L370

client.on('message', function (message){
  var messageObj = message;
  if(nowUtil.hasProperty(messageObj, "type") && nowUtil.hasProperty(nowCore.messageHandlers, messageObj.type)) {
      nowCore.messageHandlers[messageObj.type](client, messageObj.data);
  }
});

the messagObj var is simply a reference to message. I guess messageObj is supposed to be a copy of message, or is a left over from previous code.

ericz commented 13 years ago

This is probably left over from previous code

steveWang commented 13 years ago

Properly resolved as of f0c9919d33be756018fc56159d3cc7a899770840.