Skip to content

Commit

Permalink
fixed bug in test case
Browse files Browse the repository at this point in the history
  • Loading branch information
wy1009 committed Nov 7, 2017
1 parent 20e7c6e commit 14d1d58
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -905,8 +905,9 @@
assert.ok(_.has(obj, 'func'), 'works for functions too.');
obj.hasOwnProperty = null;
assert.ok(_.has(obj, 'foo'), 'works even when the hasOwnProperty method is deleted.');
var child = {};
child.prototype = obj;
function Child() {}
Child.prototype = obj;
var child = new Child();
assert.notOk(_.has(child, 'foo'), 'does not check the prototype chain for a property.');
assert.strictEqual(_.has(null, 'foo'), false, 'returns false for null');
assert.strictEqual(_.has(void 0, 'foo'), false, 'returns false for undefined');
Expand Down

0 comments on commit 14d1d58

Please sign in to comment.