Fix for Chrome (v 45) issue that key is sometimes undefined outside of the for-in loop.

This commit is contained in:
Larissa Smith 2015-09-17 15:45:39 -06:00
parent bb2910673a
commit fc8b4db796

View File

@ -805,10 +805,12 @@ if (typeof define === 'function' && define.amd) {
// Own properties are enumerated firstly, so to speed up, // Own properties are enumerated firstly, so to speed up,
// if last one is own, then all properties are own. // if last one is own, then all properties are own.
var key; var lastKey;
for ( key in obj ) {} for (var key in obj ) {
lastKey = key;
}
return key === undefined || hasOwn.call( obj, key ); return lastKey === undefined || hasOwn.call( obj, lastKey );
}; };