From 476657ecad567e2850a53e75259e58c840a6a392 Mon Sep 17 00:00:00 2001 From: Joe DF <3848219+joedf@users.noreply.github.com> Date: Mon, 10 Oct 2022 15:12:30 -0400 Subject: [PATCH 1/2] undefined check for obj. descriptor --- src/openseadragon.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/openseadragon.js b/src/openseadragon.js index 685ef10f..04184d4e 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -1102,12 +1102,17 @@ function OpenSeadragon( options ){ // Extend the base object for ( name in options ) { var descriptor = Object.getOwnPropertyDescriptor(options, name); - if (descriptor.get || descriptor.set) { - Object.defineProperty(target, name, descriptor); - continue; - } - copy = descriptor.value; + if (descriptor !== undefined) { + if (descriptor.get || descriptor.set) { + Object.defineProperty(target, name, descriptor); + continue; + } + + copy = descriptor.value; + } else { + $.console.warn('Undefined descriptior obtained for the "' + name + '" property in extended object.'); + } // Prevent never-ending loop if ( target === copy ) { From aec24d6dd78bd7ffd4ce293c0cc4b89933080df8 Mon Sep 17 00:00:00 2001 From: Joe DF <3848219+joedf@users.noreply.github.com> Date: Wed, 19 Oct 2022 16:07:35 -0400 Subject: [PATCH 2/2] add continue, update warning msg --- src/openseadragon.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openseadragon.js b/src/openseadragon.js index 04184d4e..45b36da7 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -1111,7 +1111,8 @@ function OpenSeadragon( options ){ copy = descriptor.value; } else { - $.console.warn('Undefined descriptior obtained for the "' + name + '" property in extended object.'); + $.console.warn('Could not copy inherited property "' + name + '".'); + continue; } // Prevent never-ending loop