File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -500,10 +500,15 @@ jQuery.extend({
500
500
return false ;
501
501
}
502
502
503
- // Not own constructor property must be Object
504
- if ( obj . constructor &&
505
- ! hasOwn . call ( obj , "constructor" ) &&
506
- ! hasOwn . call ( obj . constructor . prototype , "isPrototypeOf" ) ) {
503
+ try {
504
+ // Not own constructor property must be Object
505
+ if ( obj . constructor &&
506
+ ! hasOwn . call ( obj , "constructor" ) &&
507
+ ! hasOwn . call ( obj . constructor . prototype , "isPrototypeOf" ) ) {
508
+ return false ;
509
+ }
510
+ } catch ( e ) {
511
+ // IE8,9 Will throw exceptions on certain host objects #9897
507
512
return false ;
508
513
}
509
514
Original file line number Diff line number Diff line change @@ -290,7 +290,7 @@ test("type", function() {
290
290
} ) ;
291
291
292
292
test ( "isPlainObject" , function ( ) {
293
- expect ( 14 ) ;
293
+ expect ( 15 ) ;
294
294
295
295
stop ( ) ;
296
296
@@ -331,6 +331,13 @@ test("isPlainObject", function() {
331
331
// Window
332
332
ok ( ! jQuery . isPlainObject ( window ) , "window" ) ;
333
333
334
+ try {
335
+ jQuery . isPlainObject ( window . location ) ;
336
+ ok ( true , "Does not throw exceptions on host objects" ) ;
337
+ } catch ( e ) {
338
+ ok ( false , "Does not throw exceptions on host objects -- FAIL" ) ;
339
+ }
340
+
334
341
try {
335
342
var iframe = document . createElement ( "iframe" ) ;
336
343
document . body . appendChild ( iframe ) ;
You can’t perform that action at this time.
0 commit comments