From 69afb2aed332056f46ff2b2380d2dd5283f4c688 Mon Sep 17 00:00:00 2001 From: Alexander Marks Date: Mon, 15 Jul 2019 15:57:42 -0700 Subject: [PATCH] Add JS compiler bug link --- src/lib/updating-element.ts | 7 ++++--- src/lit-element.ts | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib/updating-element.ts b/src/lib/updating-element.ts index b270135c..440acaa7 100644 --- a/src/lib/updating-element.ts +++ b/src/lib/updating-element.ts @@ -193,8 +193,9 @@ type UpdateState = typeof STATE_HAS_UPDATED|typeof STATE_UPDATE_REQUESTED| /** * The Closure JS Compiler doesn't currently have good support for static - * property semantics where "this" is dynamic, so we use this hack to bypass - * any rewriting by the compiler. + * property semantics where "this" is dynamic (e.g. + * https://github.com/google/closure-compiler/issues/3177 and others) so we use + * this hack to bypass any rewriting by the compiler. */ const finalized = 'finalized'; @@ -220,7 +221,7 @@ export abstract class UpdatingElement extends HTMLElement { /** * Marks class as having finished creating properties. */ - protected static [finalized] = true; + protected static[finalized] = true; /** * Memoized list of all class properties, including any superclass properties. diff --git a/src/lit-element.ts b/src/lit-element.ts index 3c64351b..cdd14bc4 100644 --- a/src/lit-element.ts +++ b/src/lit-element.ts @@ -67,7 +67,7 @@ export class LitElement extends UpdatingElement { * Note this property name is a string to prevent breaking Closure JS Compiler * optimizations. See updating-element.ts for more information. */ - protected static ['finalized'] = true; + protected static['finalized'] = true; /** * Render method used to render the lit-html TemplateResult to the element's * DOM. @@ -89,7 +89,7 @@ export class LitElement extends UpdatingElement { /** @nocollapse */ protected static finalize() { // The Closure JS Compiler does not always preserve the correct "this" - // when calling static super methods, so explicitly bind here. + // when calling static super methods (b/137460243), so explicitly bind. super.finalize.apply(this); // Prepare styling that is stamped at first render time. Styling // is built from user provided `styles` or is inherited from the superclass.