mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Core: Restore 1.x isPlainObject constructor checks
- Guard isPlainObject against inherited scalar constructors Fixes gh-2982 Close gh-2985
This commit is contained in:
committed by
Timmy Willison
parent
0f5f0c981a
commit
0c1f72667d
@@ -235,8 +235,10 @@ jQuery.extend( {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Not own constructor property must be Object
|
||||
if ( obj.constructor &&
|
||||
!hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
|
||||
!hasOwn.call( obj, "constructor" ) &&
|
||||
!hasOwn.call( obj.constructor.prototype || {}, "isPrototypeOf" ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user