Browse Source

Merge branch 'feature/mongo_2.6.5' into feature/mongo_2.6.5_markdown

Kyle P Davis 10 years ago
parent
commit
6f97216556
2 changed files with 11 additions and 10 deletions
  1. 10 9
      lib/matcher/ArrayFilterEntries.js
  2. 1 1
      lib/matcher/InMatchExpression.js

+ 10 - 9
lib/matcher/ArrayFilterEntries.js

@@ -186,14 +186,15 @@ proto.size = function size(){
 	return this._equalities.length + this._regexes.length;
 };
 
-proto.debugString = function debugString(){
-	var debug = "[ ";
-	for (var i = 0; i < this._equalities.length; i++){
-		debug += this._equalities[i].toString() + " ";
-	}
-	for (var j = 0; j < this._regexes.length; j++){
-		debug += this._regexes[j].shortDebugString() + " ";
-	}
-	debug += "]";
+proto.debugString = function debugString() {
+	var debug = "[" +
+		this._equalities.map(function(eq) {
+			return JSON.stringify(eq);
+		})
+		.concat(this._regexes.map(function(re) {
+			return JSON.stringify(re);
+		}))
+		.join(", ") +
+		"]";
 	return debug;
 };

+ 1 - 1
lib/matcher/InMatchExpression.js

@@ -75,7 +75,7 @@ proto.matchesSingleElement = function matchesSingleElement(e) {
 proto.debugString = function debugString(level) {
 	return this._debugAddSpace( level ) +
 		this.path() + " $in " +
-		this._arrayEntries +
+		this._arrayEntries.debugString() +
 		(this.getTag() ? this.getTag().debugString() : "") +
 		"\n";
 };