[Groonga-commit] groonga/express-kotoumi [master] Receive returned values from toBackend/toClient filters correctly

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Feb 7 17:38:47 JST 2013


YUKI Hiroshi	2013-02-07 17:38:47 +0900 (Thu, 07 Feb 2013)

  New Revision: ff692c069d21e12bcf10d21f922bdf98e141a0d8
  https://github.com/groonga/express-kotoumi/commit/ff692c069d21e12bcf10d21f922bdf98e141a0d8

  Log:
    Receive returned values from toBackend/toClient filters correctly

  Modified files:
    lib/frontend/socket.io-adaptor.js

  Modified: lib/frontend/socket.io-adaptor.js (+15 -6)
===================================================================
--- lib/frontend/socket.io-adaptor.js    2013-02-07 17:35:42 +0900 (aee514d)
+++ lib/frontend/socket.io-adaptor.js    2013-02-07 17:38:47 +0900 (ae85261)
@@ -36,8 +36,11 @@ exports.register = function(application, server, params) {
     return (function(data) {
       var commandDefinition = unifiedCommandSet[commandName];
 
-      if (commandDefinition.toBackend)
-        commandName, data = commandDefinition.toBackend(commandName, data);
+      if (commandDefinition.toBackend) {
+        var result = commandDefinition.toBackend(commandName, data);
+        commandName = result[0];
+        data = result[1];
+      }
 
       var callback = null;
       var options = {};
@@ -46,8 +49,11 @@ exports.register = function(application, server, params) {
           var event = event.type;
           var data = envelope.body;
 
-          if (commandDefinition.toClient)
-            event, data = commandDefinition.toClient(event, data);
+          if (commandDefinition.toClient) {
+            var result = commandDefinition.toClient(event, data);
+            event = result[0];
+            data = result[1];
+          }
 
           socket.emit(event, data);
         };
@@ -65,8 +71,11 @@ exports.register = function(application, server, params) {
       var event = envelope.type;
       var data = envelope.body;
 
-      if (commandDefinition.toClient)
-        event, data = commandDefinition.toClient(event, body);
+      if (commandDefinition.toClient) {
+        var result = commandDefinition.toClient(event, body);
+        event = result[0];
+        data = result[1];
+      }
 
       socket.emit(event, data);
     });
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index