Ensure _.has returns false for nested inherited properties. [closes #2073]

This commit is contained in:
John-David Dalton
2016-03-02 07:54:27 -08:00
parent d59c644a10
commit c5344d5336
2 changed files with 21 additions and 4 deletions

View File

@@ -7096,6 +7096,17 @@
});
});
QUnit.test('`_.' + methodName + '` should return `' + (isHas ? 'false' : 'true') + '` for nested inherited properties', function(assert) {
assert.expect(2);
function Foo() {}
Foo.prototype.a = { 'b': 1 };
lodashStable.each(['a.b', ['a', 'b']], function(path) {
assert.strictEqual(func(new Foo, path), !isHas);
});
});
QUnit.test('`_.' + methodName + '` should return `true` for index values within bounds for arrays, `arguments` objects, and strings', function(assert) {
assert.expect(1);