File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -412,12 +412,17 @@ jQuery.extend({
412
412
} ,
413
413
414
414
isPlainObject : function ( obj ) {
415
- // Not plain objects: params that are not [[Class]] "[object Object]", DOM nodes, window
415
+ // Not plain objects:
416
+ // - Any object or value whose internal [[Class]] property is not "[object Object]"
417
+ // - DOM nodes
418
+ // - window
416
419
if ( jQuery . type ( obj ) !== "object" || obj . nodeType || jQuery . isWindow ( obj ) ) {
417
420
return false ;
418
421
}
419
422
420
423
// Support: Firefox >16
424
+ // The try/catch supresses exceptions thrown when attempting to access
425
+ // the "constructor" property of certain host objects, ie. |window.location|
421
426
try {
422
427
if ( obj . constructor &&
423
428
! core_hasOwn . call ( obj . constructor . prototype , "isPrototypeOf" ) ) {
@@ -427,6 +432,8 @@ jQuery.extend({
427
432
return false ;
428
433
}
429
434
435
+ // If the function hasn't returned already, we're confident that
436
+ // |obj| is a plain object, created by {} or constructed with new Object
430
437
return true ;
431
438
} ,
432
439
You can’t perform that action at this time.
0 commit comments