Core: Restore 1.x isPlainObject constructor checks

- Guard isPlainObject against inherited scalar constructors

Fixes gh-2982
Close gh-2985
This commit is contained in:
Richard Gibson
2016-03-11 10:48:00 -05:00
committed by Timmy Willison
parent 0f5f0c981a
commit 0c1f72667d
2 changed files with 13 additions and 2 deletions

View File

@@ -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;
}