浏览代码

EAGLESIX-2721: test case added and console.log statements removed

Jake Delaney 11 年之前
父节点
当前提交
1af0da2727

+ 0 - 2
lib/pipeline/expressions/ConcatExpression.js

@@ -29,7 +29,6 @@ proto.getOpName = function getOpName(){
  * @method evaluate
  **/
 proto.evaluateInternal = function evaluateInternal(vars) {
-	console.log("Here");
 	var n = this.operands.length,
 		result = "";
 
@@ -38,7 +37,6 @@ proto.evaluateInternal = function evaluateInternal(vars) {
 		var value = this.operands[i].evaluateInternal(vars);
 
 		if (value === null || value === undefined){
-			console.log("... and nullish");
 			return null;
 		}
 

+ 5 - 0
test/lib/pipeline/expressions/ConcatExpression_test.js

@@ -53,6 +53,11 @@ module.exports = {
 				var b = a.evaluate({a:null});
 				assert.equal(b, null);
 			},
+			"should return null if an operand evaluates to undefined; {$concat:[my,$a]}": function testNull(){
+				var a = Expression.parseOperand({$concat:["my","$a"]}, this.vps);
+				var b = a.evaluate({a:undefined});
+				assert.equal(b, null);
+			},
 			"should throw if an operand is a number": function testNull(){
 				assert.throws(function(){
 					Expression.parseOperand({$concat:["my","$a"]}, this.vps).evaluate({a:100});