mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 01:57:50 +00:00
Update vendors, rebuild minified files, update docs/license.
Former-commit-id: 689793b6e5c4bbae917e726dc646902c697ce3a7
This commit is contained in:
12
vendor/underscore/test/objects.js
vendored
12
vendor/underscore/test/objects.js
vendored
@@ -555,4 +555,16 @@ $(document).ready(function() {
|
||||
value();
|
||||
ok(returned == 6 && intercepted == 6, 'can use tapped objects in a chain');
|
||||
});
|
||||
|
||||
test("has", function () {
|
||||
var obj = {foo: "bar", func: function () {} };
|
||||
ok (_.has(obj, "foo"), "has() checks that the object has a property.");
|
||||
ok (_.has(obj, "baz") == false, "has() returns false if the object doesn't have the property.");
|
||||
ok (_.has(obj, "func"), "has() works for functions too.");
|
||||
obj.hasOwnProperty = null;
|
||||
ok (_.has(obj, "foo"), "has() works even when the hasOwnProperty method is deleted.");
|
||||
child = {};
|
||||
child.prototype = obj;
|
||||
ok (_.has(child, "foo") == false, "has() does not check the prototype chain for a property.")
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user