summaryrefslogtreecommitdiffstats
path: root/js/vendor/jquery/src/core.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/vendor/jquery/src/core.js')
-rw-r--r--js/vendor/jquery/src/core.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/js/vendor/jquery/src/core.js b/js/vendor/jquery/src/core.js
index f27306587..713c1a3cd 100644
--- a/js/vendor/jquery/src/core.js
+++ b/js/vendor/jquery/src/core.js
@@ -223,6 +223,7 @@ jQuery.extend( {
},
isPlainObject: function( obj ) {
+ var key;
// Not plain objects:
// - Any object or value whose internal [[Class]] property is not "[object Object]"
@@ -232,14 +233,18 @@ 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;
}
- // If the function hasn't returned already, we're confident that
- // |obj| is a plain object, created by {} or constructed with new Object
- return true;
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own
+ for ( key in obj ) {}
+
+ return key === undefined || hasOwn.call( obj, key );
},
isEmptyObject: function( obj ) {