Browse Source

EAGLESIX-2714 Expression was inheriting from the wrong base class; Added missing error codes.

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

+ 3 - 3
lib/pipeline/expressions/SetEqualsExpression.js

@@ -15,7 +15,7 @@ var SetEqualsExpression = module.exports = function SetEqualsExpression() {
 	this.nargs = 2;
 
 	base.call(this);
-}, klass = SetEqualsExpression, base = require("./NaryBaseExpressionT")(SetEqualsExpression), proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
+}, klass = SetEqualsExpression, base = require("./VariadicExpressionT")(SetEqualsExpression), proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
 
 // DEPENDENCIES
 var Value = require("../Value"),
@@ -28,7 +28,7 @@ proto.getOpName = function getOpName() {
 };
 
 proto.validateArguments = function validateArguments(args) {
-	if (args.length < 2) throw new Error("Two or more arguments requird. Got " + arguments.length);
+	if (args.length < 2) throw new Error("Two or more arguments required. Got " + arguments.length+"; code 17045");
 };
 /**
  * Takes arrays. Returns true if the arrays have the same values (after duplicates are removed). Returns false otherwise.
@@ -41,7 +41,7 @@ proto.evaluateInternal = function evaluateInternal(vars) {
 	for (var i = 0; i < n; i++){
 		var nextEntry = this.operands[i].evaluateInternal(vars);
 
-		if(!(nextEntry instanceof Array)) throw new Error("All operands of " + this.getOpName() +" must be arrays. One argument is of type: " + typeof nextEntry);
+		if(!(nextEntry instanceof Array)) throw new Error("All operands of " + this.getOpName() +" must be arrays. One argument is of type: " + typeof nextEntry+"; code 17044");
 
 		if(i == 0){
 			lhs = Helpers.arrayToSet(nextEntry);