aborting loop on finding

This commit is contained in:
leider 2014-02-09 15:52:58 +01:00
parent 350a802a4e
commit 2c78b57824

View file

@ -150,8 +150,10 @@ module.exports = function (chai, _) {
var expected = false;
if (_.type(obj) === 'array' && _.type(val) === 'object') {
for (var i in obj) {
if (_.eql(obj[i], val))
if (_.eql(obj[i], val)) {
expected = true;
break;
}
}
} else if (_.type(val) === 'object') {
if (!flag(this, 'negate')) {