},
isEmptyObject: function( obj ) {
- var name = "";
- for(name in obj) break;
- return !name;
+ for(var name in obj)
+ return false;
+ return true;
},
// check if an element is in a (or is an) XML document
ok( jQuery.makeArray(document.getElementById('form')).length >= 13, "Pass makeArray a form (treat as elements)" );
});
+
+test("jQuery.isEmptyObject", function(){
+ expect(2);
+
+ equals(true, jQuery.isEmptyObject({}), "isEmptyObject on empty object literal" );
+ equals(false, jQuery.isEmptyObject({a:1}), "isEmptyObject on non-empty object literal" );
+
+ // What about this ?
+ // equals(true, jQuery.isEmptyObject(null), "isEmptyObject on null" );
+});
\ No newline at end of file