|
|
@@ -47,7 +47,9 @@ klass.parse = function parse(expr, vps) {
|
|
|
var args = Expression.parseOperand(expr, vps);
|
|
|
// what is args? If it is an array of scalars (array mode) or an array of objects (object mode), we're ok.
|
|
|
// In the latter case, I am very not ok with the assuming if, then, and else are in a known order which is
|
|
|
-// what the original code implies.
|
|
|
+// what the original code implies. It looks like if we see an 'if' we set this.operands[0]. If we see 'then', we set
|
|
|
+// this.operands[1], and if we see 'else' we set operands[2]. Bugcheck on unknown values. Bugcheck on insufficent
|
|
|
+// numbers of values, AKA !== 3
|
|
|
if (args[0] !== "if")
|
|
|
throw new Error("Missing 'if' parameter to $cond");
|
|
|
if (args[1] !== "then")
|