From 6a995a2383be5bbb6d28b65ca94998e621c543cc Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Thu, 27 Apr 2017 10:43:34 -0700 Subject: [PATCH] set `isAttached` constructor (for closure) but set to undefined so not picked up as proto property (avoids initial binding value) --- closure.log | 20 ++++++++++++++++---- lib/legacy/legacy-element-mixin.html | 6 ++++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/closure.log b/closure.log index 3b9f28a74d..47bfeea094 100644 --- a/closure.log +++ b/closure.log @@ -5,12 +5,24 @@ Found : undefined return window.Polymer._polymerFn(info); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +/polymer.html_script_1.js:44: WARNING - The right side in the assignment is not a subtype of the left side. +Expected : T +Found : Function|null +More details: +The found type is a union that includes an unexpected type: null + mixin = cachingMixin(mixin); + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + /polymer.html_script_1.js:44: WARNING - Invalid type for parameter 1 of function cachingMixin. Expected : Function|null Found : T - let cachedMixin = cachingMixin(mixin); - ^^^^^ + mixin = cachingMixin(mixin); + ^^^^^ + +/polymer.html_script_1.js:46: WARNING - Cannot create property __dedupeId on non-object type T. + mixin.__dedupeId = ++dedupeId; + ^^^^^ /polymer.html_script_1.js:47: WARNING - Returned type does not match declared return type. Expected : T @@ -693,7 +705,7 @@ Found : PolymerElement !(window.customElements.polyfillWrapFlushCallback); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -/polymer.html_script_22.js:855: WARNING - Function this.splice: called with 3 argument(s). Function requires at least 4 argument(s) and at most 4. +/polymer.html_script_22.js:857: WARNING - Function this.splice: called with 3 argument(s). Function requires at least 4 argument(s) and at most 4. return this.splice(arrayOrPath, index, 1); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1366,4 +1378,4 @@ externs/closure-types.js:759: WARNING - property toggle on interface Polymer_Arr Polymer_ArraySelectorMixin.prototype.toggle; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -0 error(s), 297 warning(s), 72.7% typed +0 error(s), 299 warning(s), 72.7% typed diff --git a/lib/legacy/legacy-element-mixin.html b/lib/legacy/legacy-element-mixin.html index 7762c871c7..9a1ff66f65 100644 --- a/lib/legacy/legacy-element-mixin.html +++ b/lib/legacy/legacy-element-mixin.html @@ -68,10 +68,12 @@ constructor() { super(); this.root = this; - this.created(); - this.isAttached = false; + // initialize for closure but don't make false or a binding will see + // this setting. + this.isAttached = undefined; this.__boundListeners = null; this._debouncers = null; + this.created(); } /**