Browse Source

EAGLESIX-2715: minor code changes

Jake Delaney 11 years ago
parent
commit
54f026a10a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      lib/pipeline/expressions/SetIntersectionExpression.js

+ 2 - 2
lib/pipeline/expressions/SetIntersectionExpression.js

@@ -35,8 +35,8 @@ proto.getOpName = function getOpName() {
 proto.evaluateInternal = function evaluateInternal(vars) {
 	var object1 = this.operands[0].evaluateInternal(vars),
 		object2 = this.operands[1].evaluateInternal(vars);
-	if (object1 instanceof Array) throw new Error(this.getOpName() + ": object 1 must be an object");
-	if (object2 instanceof Array) throw new Error(this.getOpName() + ": object 2 must be an object");
+	if (object1 instanceof Array || typeof object1 != object) throw new Error(this.getOpName() + ": object 1 must be an object. Got a(n) " + typeof object1);
+	if (object2 instanceof Array || typeof object2 != object) throw new Error(this.getOpName() + ": object 2 must be an object. Got a(n) " + typeof object2);
 
 	var result = object1.filter(function(n) {
 		return object2.indexOf(n) > -1;