Browse Source

REFS DEVOPS-242 Changed static parse and fixed remaining test cases

David Aebersold 11 years ago
parent
commit
9f0f6717bf

+ 2 - 3
lib/pipeline/expressions/ConstantExpression.js

@@ -59,7 +59,6 @@ proto.serialize = function(rawValue){
 //TODO:	proto.addToBsonObj   --- may be required for $project to work -- my hope is that we can implement toJSON methods all around and use that instead
 //TODO:	proto.addToBsonObj   --- may be required for $project to work -- my hope is that we can implement toJSON methods all around and use that instead
 //TODO:	proto.addToBsonArray
 //TODO:	proto.addToBsonArray
 
 
-
 /** Register Expression */
 /** Register Expression */
-Expression.registerExpression("$const",ConstantExpression.parse);
-Expression.registerExpression("$literal", ConstantExpression.parse); // alias
+Expression.registerExpression("$const",proto.parse);
+Expression.registerExpression("$literal", proto.parse); // alias

+ 2 - 2
test/lib/pipeline/expressions/ConstantExpression.js

@@ -42,8 +42,8 @@ module.exports = {
 
 
 			"should output proper JSON": function testJson(){
 			"should output proper JSON": function testJson(){
 				var expr = new ConstantExpression(5);
 				var expr = new ConstantExpression(5);
-				assert.strictEqual(expr.toJSON(), 5);
-				assert.deepEqual(expr.toJSON(true), {$const:5});
+				assert.strictEqual(expr.serialize(), 5);
+				assert.deepEqual(expr.serialize(true), {$const:5});
 			}
 			}
 
 
 		}
 		}