[Groonga-commit] droonga/express-droonga at eb00891 [master] Detect defaualt handler correctly

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Jan 9 17:03:48 JST 2014


YUKI Hiroshi	2014-01-09 17:03:48 +0900 (Thu, 09 Jan 2014)

  New Revision: eb00891309c6c288789912d1792f22ee98a3fcb8
  https://github.com/droonga/express-droonga/commit/eb00891309c6c288789912d1792f22ee98a3fcb8

  Message:
    Detect defaualt handler correctly

  Modified files:
    lib/adapter/command.js

  Modified: lib/adapter/command.js (+4 -3)
===================================================================
--- lib/adapter/command.js    2014-01-09 16:52:45 +0900 (c3161b3)
+++ lib/adapter/command.js    2014-01-09 17:03:48 +0900 (1e63bc5)
@@ -115,9 +115,10 @@ HTTPCommand.extend = function(targetClass) {
 
   Object.defineProperty(targetClass.prototype, 'onHandle', {
     get: function() {
-      if (!this._options.onHandle)
+      var handler = this._options.onHandle || this._onHandle;
+      if (!handler)
         throw new Error('onHandle() is missing');
-      return this._options.onHandle
+      return handler;
     }
   });
 };
@@ -193,7 +194,7 @@ HTTPStreaming.extend = function(targetClass) {
     };
 
   var connectionsCount = 0;
-  targetClass.prototype.onHandle = function(request, response, connection) {
+  targetClass.prototype._onHandle = function(request, response, connection) {
     connectionsCount++;
     var self = this;
 
-------------- next part --------------
HTML����������������������������...
下載 



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