|
|
@@ -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;
|