Move LOGICAL_OPERATORS back to file scope

This commit is contained in:
Slava Kim
2013-11-26 16:19:09 -08:00
committed by David Glasser
parent 2a4189a32a
commit 97043de7e4
2 changed files with 2 additions and 2 deletions

View File

@@ -95,7 +95,7 @@ var compileValueSelector = function (valueSelector, selector, cursor) {
};
// XXX can factor out common logic below
LOGICAL_OPERATORS = {
var LOGICAL_OPERATORS = {
"$and": function(subSelector, operators, cursor) {
if (!isArray(subSelector) || _.isEmpty(subSelector))
throw Error("$and/$or/$nor must be nonempty array");

View File

@@ -107,7 +107,7 @@ var getPaths = MinimongoTest.getSelectorPaths = function (sel) {
if (k === "$where")
return ''; // matches everything
// we branch from $or/$and/$nor operator
if (_.has(LOGICAL_OPERATORS, k))
if (_.contains(['$or', '$and', '$nor'], k))
return _.map(v, getPaths);
// the value is a literal or some comparison operator
return k;