|
|
@@ -19,7 +19,8 @@ var Expression = module.exports = function Expression() {
|
|
|
|
|
|
|
|
|
var Value = require("../Value"),
|
|
|
- Document = require("../Document");
|
|
|
+ Document = require("../Document"),
|
|
|
+ Variables = require("./Variables");
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -84,12 +85,12 @@ var ObjectCtx = Expression.ObjectCtx = (function() {
|
|
|
*/
|
|
|
klass.parseObject = function parseObject(obj, ctx, vps) {
|
|
|
if (!(ctx instanceof ObjectCtx)) throw new Error("ctx must be ObjectCtx");
|
|
|
- /*
|
|
|
- An object expression can take any of the following forms:
|
|
|
+ /*
|
|
|
+ An object expression can take any of the following forms:
|
|
|
|
|
|
- f0: {f1: ..., f2: ..., f3: ...}
|
|
|
- f0: {$operator:[operand1, operand2, ...]}
|
|
|
- */
|
|
|
+ f0: {f1: ..., f2: ..., f3: ...}
|
|
|
+ f0: {$operator:[operand1, operand2, ...]}
|
|
|
+ */
|
|
|
|
|
|
var expression, // the result
|
|
|
expressionObject, // the alt result
|
|
|
@@ -205,7 +206,7 @@ klass.parseExpression = function parseExpression(exprElementKey, exprElementValu
|
|
|
op = Expression.expressionParserMap;
|
|
|
if (!op) throw new Error("invalid operator : " + exprElementKey + "; uassert code 15999");
|
|
|
|
|
|
- // make the expression node
|
|
|
+ // make the expression node
|
|
|
return op(exprElementValue, vps);
|
|
|
};
|
|
|
|