Added a method to myKlass.
authorrkatic <robert.katic@gmail.com>
Mon, 9 Nov 2009 10:55:25 +0000 (18:55 +0800)
committerJohn Resig <jeresig@gmail.com>
Mon, 9 Nov 2009 11:32:24 +0000 (19:32 +0800)
If an object's prototype is "empty", then isObject returns true!

test/unit/core.js

index 25ff1f5..4b1da51 100644 (file)
@@ -550,6 +550,8 @@ test("jQuery.extend(Object, Object)", function() {
        same( empty.foo, optionsWithDate.foo, "Dates copy correctly" );
 
        var myKlass = function() {};
+       // Makes the class a little more realistic
+       myKlass.prototype = { someMethod: function(){} };
        empty = {};
        var optionsWithCustomObject = { foo: { date: new myKlass } };
        jQuery.extend(true, empty, optionsWithCustomObject);