return false;
}
- // Not own constructor property must be Object
- if ( obj.constructor &&
- !hasOwn.call(obj, "constructor") &&
- !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ try {
+ // Not own constructor property must be Object
+ if ( obj.constructor &&
+ !hasOwn.call(obj, "constructor") &&
+ !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+ } catch ( e ) {
+ // IE8,9 Will throw exceptions on certain host objects #9897
return false;
}
});
test("isPlainObject", function() {
- expect(14);
+ expect(15);
stop();
// Window
ok(!jQuery.isPlainObject(window), "window");
+ try {
+ jQuery.isPlainObject( window.location );
+ ok( true, "Does not throw exceptions on host objects");
+ } catch ( e ) {
+ ok( false, "Does not throw exceptions on host objects -- FAIL");
+ }
+
try {
var iframe = document.createElement("iframe");
document.body.appendChild(iframe);