|
|
@@ -3,9 +3,9 @@
|
|
|
/**
|
|
|
* Inherit from ExpressionVariadic or ExpressionFixedArity instead of directly from this class.
|
|
|
* @class NaryBaseExpressionT
|
|
|
+ * @extends mungedb-aggregate.pipeline.expressions.NaryExpression
|
|
|
* @namespace mungedb-aggregate.pipeline.expressions
|
|
|
* @module mungedb-aggregate
|
|
|
- * @extends mungedb-aggregate.pipeline.expressions.NaryExpression
|
|
|
* @constructor
|
|
|
*/
|
|
|
var NaryBaseExpressionT = module.exports = function NaryBaseExpressionT(SubClass) {
|
|
|
@@ -15,6 +15,10 @@ var NaryBaseExpressionT = module.exports = function NaryBaseExpressionT(SubClass
|
|
|
base.call(this);
|
|
|
}, klass = NaryBaseExpression, NaryExpression = require("./NaryExpression"), base = NaryExpression, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
|
|
|
|
|
|
+ //NOTE: attach statics to emulate the C++ behavior
|
|
|
+ for (var propName in base)
|
|
|
+ klass[propName] = base[propName];
|
|
|
+
|
|
|
klass.parse = function(objExpr, vps) {
|
|
|
var expr = new SubClass(),
|
|
|
args = NaryExpression.parseArguments(objExpr, vps);
|
|
|
@@ -23,8 +27,5 @@ var NaryBaseExpressionT = module.exports = function NaryBaseExpressionT(SubClass
|
|
|
return expr;
|
|
|
};
|
|
|
|
|
|
- klass.parseArguments = base.parseArguments; // NOTE: Need to explicitly
|
|
|
- // bubble static members in
|
|
|
- // our inheritance chain
|
|
|
return NaryBaseExpression;
|
|
|
};
|