浏览代码

Refs #1049 Reverted a change I made to FieldPathExpression because I had misread the mongodb test case.

http://source.rd.rcg.local/trac/eagle6/changeset/1319/Eagle6_SVN
Adam Bell 12 年之前
父节点
当前提交
428e0264bd

+ 1 - 1
lib/pipeline/expressions/FieldPathExpression.js

@@ -34,7 +34,7 @@ var FieldPathExpression = module.exports = (function(){
 	**/
 	proto._evaluatePath = function _evaluatePath(obj, i, len){
 		var fieldName = this.path.fields[i],
-			field = obj ? obj[fieldName] : undefined; // It is possible we won't have an obj (document) and we need to not fail if that is the case
+			field = obj[fieldName]; // It is possible we won't have an obj (document) and we need to not fail if that is the case
 
 		// if the field doesn't exist, quit with an undefined value
 		if (field === undefined) return undefined;

+ 0 - 1
test/lib/pipeline/accumulators/AvgAccumulator.js

@@ -36,7 +36,6 @@ module.exports = {
 
 			"should evaluate no documents": function testStuff(){
 				var avgAccumulator = createAccumulator();
-				avgAccumulator.evaluate();
 				assert.strictEqual(avgAccumulator.getValue(), 0);
 			},
 

+ 0 - 1
test/lib/pipeline/accumulators/LastAccumulator.js

@@ -36,7 +36,6 @@ module.exports = {
 
 			"should evaluate no documents": function testStuff(){
 				var lastAccumulator = createAccumulator();
-				lastAccumulator.evaluate();
 				assert.strictEqual(lastAccumulator.getValue(), undefined);
 			},
 

+ 0 - 1
test/lib/pipeline/accumulators/PushAccumulator.js

@@ -36,7 +36,6 @@ module.exports = {
 
 			"should evaluate no documents": function testStuff(){
 				var accumulator = createAccumulator();
-				accumulator.evaluate();
 				assert.deepEqual(accumulator.getValue(), []);
 			},
 

+ 0 - 1
test/lib/pipeline/accumulators/SumAccumulator.js

@@ -36,7 +36,6 @@ module.exports = {
 
 			"should evaluate no documents": function testStuff(){
 				var sumAccumulator = createAccumulator();
-				sumAccumulator.evaluate();
 				assert.strictEqual(sumAccumulator.getValue(), 0);
 			},