undefined check for obj. descriptor

This commit is contained in:
Joe DF 2022-10-10 15:12:30 -04:00
parent 39625aacaa
commit 476657ecad

View File

@ -1102,12 +1102,17 @@ function OpenSeadragon( options ){
// Extend the base object // Extend the base object
for ( name in options ) { for ( name in options ) {
var descriptor = Object.getOwnPropertyDescriptor(options, name); var descriptor = Object.getOwnPropertyDescriptor(options, name);
if (descriptor !== undefined) {
if (descriptor.get || descriptor.set) { if (descriptor.get || descriptor.set) {
Object.defineProperty(target, name, descriptor); Object.defineProperty(target, name, descriptor);
continue; continue;
} }
copy = descriptor.value; copy = descriptor.value;
} else {
$.console.warn('Undefined descriptior obtained for the "' + name + '" property in extended object.');
}
// Prevent never-ending loop // Prevent never-ending loop
if ( target === copy ) { if ( target === copy ) {