make the new faster isEmpty a little safer too

This commit is contained in:
Jeremy Ashkenas
2010-02-24 12:43:57 -05:00
parent 2c8fbe7875
commit 7824d63ce8
3 changed files with 90 additions and 90 deletions

View File

@@ -60,6 +60,7 @@ $(document).ready(function() {
ok(_.isEmpty([]), '[] is empty');
ok(!_.isEmpty({one : 1}), '{one : 1} is not empty');
ok(_.isEmpty({}), '{} is empty');
ok(_.isEmpty(new RegExp('')), 'objects with prototype properties are empty');
ok(_.isEmpty(null), 'null is empty');
ok(_.isEmpty(), 'undefined is empty');
@@ -102,7 +103,7 @@ $(document).ready(function() {
ok(_.isArguments(args), 'but the arguments object is an arguments object');
ok(!_.isArguments(_.toArray(args)), 'but not when it\'s converted into an array');
ok(!_.isArguments([1,2,3]), 'and not vanilla arrays.');
ok(_.isArguments(iArguments), 'event from another frame');
ok(_.isArguments(iArguments), 'even from another frame');
});
test("objects: isArray", function() {