diff --git a/lib/legacy/class.html b/lib/legacy/class.html index 0f10bcbe2a..33f313a1af 100644 --- a/lib/legacy/class.html +++ b/lib/legacy/class.html @@ -47,18 +47,21 @@ function copyProperties(source, target, excludeProps) { const noAccessors = source._noAccessors; - for (let p in source) { - if (!(p in excludeProps)) { - if (noAccessors) { - target[p] = source[p]; - } else { - let pd = Object.getOwnPropertyDescriptor(source, p); - if (pd) { - // ensure property is configurable so that a later behavior can - // re-configure it. - pd.configurable = true; - Object.defineProperty(target, p, pd); - } + const propertyNames = Object.getOwnPropertyNames(source); + for (let i = 0; i < propertyNames.length; i++) { + let p = propertyNames[i]; + if (p in excludeProps) { + continue; + } + if (noAccessors) { + target[p] = source[p]; + } else { + let pd = Object.getOwnPropertyDescriptor(source, p); + if (pd) { + // ensure property is configurable so that a later behavior can + // re-configure it. + pd.configurable = true; + Object.defineProperty(target, p, pd); } } } diff --git a/test/runner.html b/test/runner.html index 2402bb3174..dc0eb5c31b 100644 --- a/test/runner.html +++ b/test/runner.html @@ -82,8 +82,9 @@ 'unit/disable-upgrade.html', 'unit/shady-unscoped-style.html', 'unit/html-tag.html', - 'unit/legacy-data.html' + 'unit/legacy-data.html', // 'unit/multi-style.html' + 'unit/class-properties.html' ]; function combinations(suites, flags) { diff --git a/test/unit/class-properties.html b/test/unit/class-properties.html new file mode 100644 index 0000000000..8924e93572 --- /dev/null +++ b/test/unit/class-properties.html @@ -0,0 +1,38 @@ + + + + + + + + + + + + + \ No newline at end of file