Browse Source

EAGLESIX-2696 Added more comments to help me remember what to fix :-P

Tony Ennis 11 years ago
parent
commit
4063f9433d
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lib/pipeline/expressions/CondExpression.js

+ 3 - 1
lib/pipeline/expressions/CondExpression.js

@@ -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")