Skip to content

Commit 66a63ad

Browse files
author
soletan
committed
Update lib/connection.js
1 parent 663a965 commit 66a63ad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/connection.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,10 @@ p.parseMessage = function() {
326326

327327
if ( id in Connection.mapMsgNames )
328328
{
329-
msg.name = Connection.mapMsgNames[id];
330-
var fncName = "parse" + String.fromCharCode( id );
329+
msg.name = Connection.mapMsgNames[id];
330+
var fnc = this["parse" + String.fromCharCode( id )];
331331

332-
return fncName in this ? this[fncName]( msg ) : msg;
332+
return fnc instanceof Function ? fnc( msg ) : msg;
333333
}
334334
else
335335
throw new Error("Unrecognized message code " + id);

0 commit comments

Comments
 (0)