From d2568aa583b9dbc832223f7f061b99b64f8be1d7 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Sat, 13 Apr 2019 15:11:03 -0400 Subject: [PATCH] skip observedAttributes where appropriate - fixes #2399 --- src/compile/render-dom/index.ts | 3 ++- test/js/samples/css-shadow-dom-keyframes/expected.js | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/compile/render-dom/index.ts b/src/compile/render-dom/index.ts index d7649897c0..8ab5d25668 100644 --- a/src/compile/render-dom/index.ts +++ b/src/compile/render-dom/index.ts @@ -464,9 +464,10 @@ export default function dom( } } + ${props.length > 0 && deindent` static get observedAttributes() { return ${JSON.stringify(props.map(x => x.export_name))}; - } + }`} ${body.length > 0 && body.join('\n\n')} } diff --git a/test/js/samples/css-shadow-dom-keyframes/expected.js b/test/js/samples/css-shadow-dom-keyframes/expected.js index 2cb5b9e974..9f70b8ec66 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected.js @@ -49,10 +49,6 @@ class Component extends SvelteElement { } } } - - static get observedAttributes() { - return []; - } } customElements.define("custom-element", Component);