[Groonga-commit] groonga/gcs [master] Resolve circular reference error

Back to archive index

null+****@clear***** null+****@clear*****
2012年 7月 12日 (木) 18:09:44 JST


SHIMODA Hiroshi	2012-07-12 18:09:44 +0900 (Thu, 12 Jul 2012)

  New Revision: 6c84c71a9f17cfbe3317de1aeedac25e071144a1
  https://github.com/groonga/gcs/commit/6c84c71a9f17cfbe3317de1aeedac25e071144a1

  Log:
    Resolve circular reference error

  Modified files:
    lib/database/domain.js
    test/test-utils.js

  Modified: lib/database/domain.js (+3 -3)
===================================================================
--- lib/database/domain.js    2012-07-12 17:31:06 +0900 (0acc4e1)
+++ lib/database/domain.js    2012-07-12 18:09:44 +0900 (a0ed611)
@@ -54,7 +54,7 @@ Domain.prototype = {
   initialize: function(source, context) {
     this.context = context && new nroonga.Context(context);
     this.name = this.getName(source);
-    this.indexFields = {};
+    this.cachedIndexFields = {};
     // for validation
     this.tableName;
     this.termsTableName;
@@ -94,8 +94,8 @@ Domain.prototype = {
     return this._termsTableName;
   },
   getIndexField: function(field) {
-    return this.indexFields[field] ||
-           (this.indexFields[field] = new IndexField(field, this));
+    return this.cachedIndexFields[field] ||
+           (this.cachedIndexFields[field] = new IndexField(field, this));
   },
   get indexFields() {
     if (!this.context)

  Modified: test/test-utils.js (+2 -2)
===================================================================
--- test/test-utils.js    2012-07-12 17:31:06 +0900 (9f638fc)
+++ test/test-utils.js    2012-07-12 18:09:44 +0900 (b3235c6)
@@ -4,7 +4,7 @@ var mkdirp = require('mkdirp');
 var gcsServer = require(__dirname + '/../lib/server');
 var http = require('http');
 var Deferred = require('jsdeferred').Deferred;
-var nroonga = require('nroonga');
+var nativeNroonga = require('nroonga');
 var wrappedNroonga = require(__dirname + '/../lib/wrapped-nroonga');
 
 var temporaryDirectory = exports.temporaryDirectory = path.join(__dirname, 'tmp');
@@ -85,7 +85,7 @@ exports.createTemporaryDatabase = function() {
     path: databasePath,
     get: function() {
       return this._context ||
-             (this._context = new nroonga.Database(databasePath));
+             (this._context = new nativeNroonga.Database(databasePath));
     },
     clear: function() {
       var context = this._context;
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Download 



Groonga-commit メーリングリストの案内
Back to archive index