Browse Source

REFS DEVOPS-262 corrected invalid use of typeof

David Aebersold 11 years ago
parent
commit
dcb1db85c6
1 changed files with 2 additions and 2 deletions
  1. 2 2
      lib/pipeline/expressions/SetEqualsExpression.js

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

@@ -36,8 +36,8 @@ proto.getOpName = function getOpName() {
 proto.evaluateInternal = function evaluateInternal(doc) {
 		var array1 = this.operands[0].evaluateInternal(doc),
 				array2 = this.operands[1].evaluateInternal(doc);
-		if (typeof(array1) != "array") throw new Error(this.getOpName() + ": object 1 must be an array");
-		if (typeof(array2) != "array") throw new Error(this.getOpName() + ": object 2 must be an array");
+		if (array1 instanceof Array) throw new Error(this.getOpName() + ": object 1 must be an array");
+		if (array2 instanceof Array) throw new Error(this.getOpName() + ": object 2 must be an array");
 		array1 = array2;
 		return array1;
 };