Skip to content

Commit

Permalink
initialize properties in _initializeProperties rather than `constru…
Browse files Browse the repository at this point in the history
…ctor` (allows work to be done before `_initializeProperties` and is needed for proto/instance property initialization .
  • Loading branch information
Steven Orvell committed Apr 27, 2017
1 parent c1eda7a commit f15e4ee
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 19 deletions.
20 changes: 10 additions & 10 deletions closure.log
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ Found : Element
let parts = this.split(path);
^^^^

/polymer.html_script_8.js:117: WARNING - Function this._attributeToProperty: called with 2 argument(s). Function requires at least 3 argument(s) and at most 3.
/polymer.html_script_8.js:110: WARNING - Function this._attributeToProperty: called with 2 argument(s). Function requires at least 3 argument(s) and at most 3.
this._attributeToProperty(name, value);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -1342,39 +1342,39 @@ Found : Node{$:Object{}, __noInsertionPoint:boolean, nodeList:Array<?>}
return dom;
^^^^^^^^^^^

externs/closure-types.js:375: WARNING - property connectedCallback not defined on any supertype of Polymer_ElementMixin
externs/closure-types.js:378: WARNING - property connectedCallback not defined on any supertype of Polymer_ElementMixin
Polymer_ElementMixin.prototype.connectedCallback = function(){};
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

externs/closure-types.js:379: WARNING - property disconnectedCallback not defined on any supertype of Polymer_ElementMixin
externs/closure-types.js:382: WARNING - property disconnectedCallback not defined on any supertype of Polymer_ElementMixin
Polymer_ElementMixin.prototype.disconnectedCallback = function(){};
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

externs/closure-types.js:399: WARNING - property attributeChangedCallback not defined on any supertype of Polymer_ElementMixin
externs/closure-types.js:402: WARNING - property attributeChangedCallback not defined on any supertype of Polymer_ElementMixin
Polymer_ElementMixin.prototype.attributeChangedCallback = function(name, old, value){};
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

externs/closure-types.js:733: WARNING - property mutableData on interface Polymer_OptionalMutableData is not implemented by type OptionalMutableData
externs/closure-types.js:736: WARNING - property mutableData on interface Polymer_OptionalMutableData is not implemented by type OptionalMutableData
Polymer_OptionalMutableData.prototype.mutableData;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

externs/closure-types.js:747: WARNING - property items on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin
externs/closure-types.js:750: WARNING - property items on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin
Polymer_ArraySelectorMixin.prototype.items;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

externs/closure-types.js:750: WARNING - property multi on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin
externs/closure-types.js:753: WARNING - property multi on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin
Polymer_ArraySelectorMixin.prototype.multi;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

externs/closure-types.js:753: WARNING - property selected on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin
externs/closure-types.js:756: WARNING - property selected on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin
Polymer_ArraySelectorMixin.prototype.selected;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

externs/closure-types.js:756: WARNING - property selectedItem on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin
externs/closure-types.js:759: WARNING - property selectedItem on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin
Polymer_ArraySelectorMixin.prototype.selectedItem;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

externs/closure-types.js:759: WARNING - property toggle on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin
externs/closure-types.js:762: WARNING - property toggle on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin
Polymer_ArraySelectorMixin.prototype.toggle;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
3 changes: 3 additions & 0 deletions externs/closure-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ Polymer_TemplateStamp.prototype._removeEventListenerFromNode = function(node, ev
*/
function Polymer_PropertyEffects(){}
/**
*/
Polymer_PropertyEffects.prototype._initializeProperties = function(){};
/**
* @override
* @param {*} props
*/
Expand Down
14 changes: 7 additions & 7 deletions lib/mixins/property-accessors.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,6 @@

constructor() {
super();
this.__serializing = false;
this.__dataCounter = 0;
this.__dataInitialized = false;
this.__dataInvalid = false;
this.__data = {};
this.__dataPending = null;
this.__dataOld = null;
this._initializeProperties();
}

Expand All @@ -142,6 +135,13 @@
* @protected
*/
_initializeProperties() {
this.__serializing = false;
this.__dataCounter = 0;
this.__dataInitialized = false;
this.__dataInvalid = false;
this.__data = {};
this.__dataPending = null;
this.__dataOld = null;
if (this.__dataProto) {
this._initializeProtoProperties(this.__dataProto);
this.__dataProto = null;
Expand Down
4 changes: 2 additions & 2 deletions lib/mixins/property-effects.html
Original file line number Diff line number Diff line change
Expand Up @@ -1073,8 +1073,8 @@
return TYPES;
}

constructor() {
super();
_initializeProperties() {
super._initializeProperties();
this.__dataPendingClients = null;
this.__dataToNotify = null;
this.__dataLinkedPaths = null;
Expand Down

0 comments on commit f15e4ee

Please sign in to comment.