Added a method to myKlass.

If an object's prototype is "empty", then isObject returns true!
This commit is contained in:
rkatic 2009-11-09 18:55:25 +08:00 committed by John Resig
parent c2bbcd8833
commit b256a3a266

View file

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