mirror of
https://github.com/Polymer/polymer.git
synced 2026-08-19 01:14:44 -05:00
Remove @suppress {missingProperties}
It may break stuff in closure to use this much, so try to shape classes for closure directly. Use polymer pass v2 to remove warnings for properties defined in `properties` block
This commit is contained in:
+223
-91
@@ -1,4 +1,6 @@
|
||||
gulp-google-closure-compiler: externs/closure-types.js:1053: WARNING - property connectedCallback not defined on any supertype of Polymer_ElementMixin
|
||||
gulp-google-closure-compiler: WARNING - Type annotation references non-existent type Polymer.ElementProperties.
|
||||
|
||||
externs/closure-types.js:1053: WARNING - property connectedCallback not defined on any supertype of Polymer_ElementMixin
|
||||
Polymer_ElementMixin.prototype.connectedCallback = function(){};
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@@ -6,128 +8,258 @@ externs/closure-types.js:1057: WARNING - property disconnectedCallback not defin
|
||||
Polymer_ElementMixin.prototype.disconnectedCallback = function(){};
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
externs/closure-types.js:2036: WARNING - property mutableData on interface Polymer_OptionalMutableData is not implemented by type OptionalMutableData
|
||||
Polymer_OptionalMutableData.prototype.mutableData;
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
polymer.html_script_11.js:464: WARNING - Property negate never defined on $jscomp$destructuring$var0 of type {event: ?}
|
||||
let {event, negate} = binding.parts[0];
|
||||
^^^^^^
|
||||
|
||||
externs/closure-types.js:2051: WARNING - property items on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin
|
||||
Polymer_ArraySelectorMixin.prototype.items;
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
polymer.html_script_11.js:490: WARNING - Property target never defined on binding of type {kind: string}
|
||||
if (binding.kind === 'attribute' && binding.target[0] === '-') {
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
externs/closure-types.js:2054: WARNING - property multi on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin
|
||||
Polymer_ArraySelectorMixin.prototype.multi;
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
polymer.html_script_11.js:491: WARNING - Property target never defined on binding of type {kind: string}
|
||||
console.warn('Cannot set attribute ' + binding.target +
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
externs/closure-types.js:2063: WARNING - property toggle on interface Polymer_ArraySelectorMixin is not implemented by type ArraySelectorMixin
|
||||
Polymer_ArraySelectorMixin.prototype.toggle;
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
polymer.html_script_11.js:494: WARNING - Property dependencies never defined on part of type Object
|
||||
let dependencies = part.dependencies;
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_26.js:173: WARNING - Property mutableData never defined on this of type OptionalMutableData
|
||||
return mutablePropertyChange(this, property, value, old, this.mutableData);
|
||||
^^^^^^^^^^^^^^^^
|
||||
polymer.html_script_11.js:565: WARNING - Property kind never defined on binding of type {target: string}
|
||||
value = Polymer.sanitizeDOMValue(value, binding.target, binding.kind, node);
|
||||
^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_31.js:318: WARNING - Property as never defined on this of type DomRepeat{template: Element|null}
|
||||
instanceProps[this.as] = true;
|
||||
^^^^^^^
|
||||
polymer.html_script_11.js:569: WARNING - Property target never defined on binding of type {kind: ?}
|
||||
inst._valueToNodeAttribute(/** @type {Element} */(node), value, binding.target);
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_31.js:319: WARNING - Property indexAs never defined on this of type DomRepeat{template: Element|null}
|
||||
instanceProps[this.indexAs] = true;
|
||||
^^^^^^^^^^^^
|
||||
polymer.html_script_11.js:572: WARNING - Property target never defined on binding of type {kind: ?}
|
||||
let prop = binding.target;
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_31.js:320: WARNING - Property itemsIndexAs never defined on this of type DomRepeat{template: Element|null}
|
||||
instanceProps[this.itemsIndexAs] = true;
|
||||
^^^^^^^^^^^^^^^^^
|
||||
polymer.html_script_11.js:602: WARNING - Property kind never defined on binding of type Object
|
||||
if (binding.kind !== 'attribute') {
|
||||
^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_31.js:418: WARNING - Property _targetFrameTime never defined on this of type DomRepeat
|
||||
let ratio = this._targetFrameTime / (currChunkTime - this.__lastChunkTime);
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
polymer.html_script_11.js:604: WARNING - Property target never defined on binding of type Object
|
||||
if (binding.target === 'textContent' ||
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_31.js:450: WARNING - Property delay never defined on this of type DomRepeat{__observePaths: truthy}
|
||||
this.__debounceRender(this.__render, this.delay);
|
||||
^^^^^^^^^^
|
||||
polymer.html_script_11.js:605: WARNING - Property target never defined on binding of type Object
|
||||
(node.localName == 'input' && binding.target == 'value')) {
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_31.js:495: WARNING - Property _setRenderedItemCount never defined on this of type DomRepeat{__pool: {length: number} (loose)}
|
||||
this._setRenderedItemCount(this.__instances.length);
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
polymer.html_script_11.js:643: WARNING - Property nodeInfoList never defined on $jscomp$destructuring$var1 of type {nodeList: ?}
|
||||
let {nodeList, nodeInfoList} = templateInfo;
|
||||
^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_31.js:531: WARNING - Property as never defined on this of type DomRepeat{__instances: Object, __itemsIdxToInstIdx: Object{}, __limit: number, items: ?=}
|
||||
inst._setPendingProperty(this.as, item);
|
||||
^^^^^^^
|
||||
polymer.html_script_11.js:731: WARNING - Property methodName never defined on sig of type Object
|
||||
(typeof dynamicFn !== 'object' || dynamicFn[sig.methodName]));
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_31.js:532: WARNING - Property indexAs never defined on this of type DomRepeat{__instances: Object, __itemsIdxToInstIdx: Object{}, __limit: number, items: ?=}
|
||||
inst._setPendingProperty(this.indexAs, instIdx);
|
||||
^^^^^^^^^^^^
|
||||
polymer.html_script_11.js:733: WARNING - Property methodName never defined on sig of type Object
|
||||
methodName: sig.methodName,
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_31.js:533: WARNING - Property itemsIndexAs never defined on this of type DomRepeat{__instances: Object, __itemsIdxToInstIdx: Object{}, __limit: number, items: ?=}
|
||||
inst._setPendingProperty(this.itemsIndexAs, itemIdx);
|
||||
^^^^^^^^^^^^^^^^^
|
||||
polymer.html_script_11.js:734: WARNING - Property args never defined on sig of type Object
|
||||
args: sig.args,
|
||||
^^^^^^^^
|
||||
|
||||
polymer.html_script_31.js:569: WARNING - Property as never defined on this of type DomRepeat
|
||||
model[this.as] = item;
|
||||
^^^^^^^
|
||||
polymer.html_script_11.js:738: WARNING - Property args never defined on sig of type Object
|
||||
for (let i=0, arg; (i<sig.args.length) && (arg=sig.args[i]); i++) {
|
||||
^^^^^^^^
|
||||
|
||||
polymer.html_script_31.js:570: WARNING - Property indexAs never defined on this of type DomRepeat
|
||||
model[this.indexAs] = instIdx;
|
||||
^^^^^^^^^^^^
|
||||
polymer.html_script_11.js:738: WARNING - Property args never defined on sig of type Object
|
||||
for (let i=0, arg; (i<sig.args.length) && (arg=sig.args[i]); i++) {
|
||||
^^^^^^^^
|
||||
|
||||
polymer.html_script_31.js:571: WARNING - Property itemsIndexAs never defined on this of type DomRepeat
|
||||
model[this.itemsIndexAs] = itemIdx;
|
||||
^^^^^^^^^^^^^^^^^
|
||||
polymer.html_script_11.js:746: WARNING - Property methodName never defined on sig of type Object
|
||||
model._addPropertyEffect(sig.methodName, type, {
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_31.js:580: WARNING - Property as never defined on this of type DomRepeat{__pool: {pop: LOOSE_TOP_FUNCTION} (loose)}
|
||||
inst._setPendingProperty(this.as, item);
|
||||
^^^^^^^
|
||||
polymer.html_script_11.js:944: WARNING - Property value never defined on arg of type {literal: truthy, name: ?}
|
||||
v = arg.value;
|
||||
^^^^^^^^^
|
||||
|
||||
polymer.html_script_31.js:581: WARNING - Property indexAs never defined on this of type DomRepeat{__pool: {pop: LOOSE_TOP_FUNCTION} (loose)}
|
||||
inst._setPendingProperty(this.indexAs, instIdx);
|
||||
^^^^^^^^^^^^
|
||||
polymer.html_script_11.js:1620: WARNING - Property __dataCounter never defined on this of type PropertyEffects{__dataHasPaths: false, __dataToNotify: null}
|
||||
if (this.__dataCounter == 1) {
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_31.js:582: WARNING - Property itemsIndexAs never defined on this of type DomRepeat{__pool: {pop: LOOSE_TOP_FUNCTION} (loose)}
|
||||
inst._setPendingProperty(this.itemsIndexAs, itemIdx);
|
||||
^^^^^^^^^^^^^^^^^
|
||||
polymer.html_script_11.js:1712: WARNING - Property path never defined on info of type Object{}
|
||||
notifySplices(this, array, info.path, splices);
|
||||
^^^^^^^^^
|
||||
|
||||
polymer.html_script_31.js:619: WARNING - Property as never defined on this of type DomRepeat{__instances: Object, __itemsIdxToInstIdx: Object}
|
||||
let itemPath = this.as + (itemSubPath ? '.' + itemSubPath : '');
|
||||
^^^^^^^
|
||||
polymer.html_script_11.js:1790: WARNING - Property path never defined on info of type Object{}
|
||||
notifySplice(this, array, info.path, len, items.length, []);
|
||||
^^^^^^^^^
|
||||
|
||||
polymer.html_script_31.js:642: WARNING - Property as never defined on this of type DomRepeat
|
||||
return instance && instance[this.as];
|
||||
^^^^^^^
|
||||
polymer.html_script_11.js:1814: WARNING - Property path never defined on info of type Object{}
|
||||
notifySplice(this, array, info.path, array.length, 0, [ret]);
|
||||
^^^^^^^^^
|
||||
|
||||
polymer.html_script_31.js:656: WARNING - Property indexAs never defined on this of type DomRepeat
|
||||
return instance && instance[this.indexAs];
|
||||
^^^^^^^^^^^^
|
||||
polymer.html_script_11.js:1850: WARNING - Property path never defined on info of type Object{}
|
||||
notifySplice(this, array, info.path, start, items.length, ret);
|
||||
^^^^^^^^^
|
||||
|
||||
polymer.html_script_32.js:245: WARNING - Property if never defined on this of type DomIf
|
||||
let hidden = this.__hideTemplateChildren__ || !this.if;
|
||||
^^^^^^^
|
||||
polymer.html_script_11.js:1874: WARNING - Property path never defined on info of type Object{}
|
||||
notifySplice(this, array, info.path, 0, 0, [ret]);
|
||||
^^^^^^^^^
|
||||
|
||||
polymer.html_script_33.js:154: WARNING - Property items never defined on this of type ArraySelectorMixin
|
||||
if (selected.has(this.items[idx])) {
|
||||
^^^^^^^^^^
|
||||
polymer.html_script_11.js:1898: WARNING - Property path never defined on info of type Object{}
|
||||
notifySplice(this, array, info.path, 0, items.length, []);
|
||||
^^^^^^^^^
|
||||
|
||||
polymer.html_script_33.js:155: WARNING - Property items never defined on this of type ArraySelectorMixin
|
||||
selected.set(this.items[idx], idx);
|
||||
^^^^^^^^^^
|
||||
polymer.html_script_11.js:1922: WARNING - Property path never defined on info of type Object{}
|
||||
propPath = info.path;
|
||||
^^^^^^^^^
|
||||
|
||||
polymer.html_script_11.js:2294: WARNING - Property nodeList never defined on dom of type DocumentFragment
|
||||
templateInfo.nodeList = dom.nodeList;
|
||||
^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_11.js:2307: WARNING - Property propertyEffects never defined on templateInfo of type {childNodes: Array<?>=, nodeList: ?, wasPreBound: truthy=}
|
||||
runEffects(this, templateInfo.propertyEffects, this.__data, null,
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_11.js:2323: WARNING - Property templateInfo never defined on dom of type DocumentFragment
|
||||
let templateInfo = dom.templateInfo;
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_11.js:2361: WARNING - Property _parseTemplateNode never defined on propertyEffectsBase of type propertyEffectsBase<|function(new:propertyEffectsBase):?|>
|
||||
let noted = super._parseTemplateNode(node, templateInfo, nodeInfo);
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_11.js:2426: WARNING - Property _parseTemplateNodeAttribute never defined on propertyEffectsBase of type propertyEffectsBase<|function(new:propertyEffectsBase):?|>
|
||||
return super._parseTemplateNodeAttribute(node, templateInfo, nodeInfo, name, value);
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_11.js:2444: WARNING - Property _parseTemplateNestedTemplate never defined on propertyEffectsBase of type propertyEffectsBase<|function(new:propertyEffectsBase):?|>
|
||||
let noted = super._parseTemplateNestedTemplate(node, templateInfo, nodeInfo);
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_11.js:2517: WARNING - Property args never defined on $jscomp$destructuring$var2 of type Object
|
||||
let {args, methodName} = signature;
|
||||
^^^^
|
||||
|
||||
polymer.html_script_11.js:2517: WARNING - Property methodName never defined on $jscomp$destructuring$var2 of type Object
|
||||
let {args, methodName} = signature;
|
||||
^^^^^^^^^^
|
||||
|
||||
polymer.html_script_11.js:2573: WARNING - Property source never defined on part of type Object
|
||||
} else if (path != part.source) {
|
||||
^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_11.js:2574: WARNING - Property source never defined on part of type Object
|
||||
value = Polymer.Path.get(inst, part.source);
|
||||
^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_12.js:158: WARNING - Property prototype never defined on klass of type HTMLElement{__classProperties: Object|null}
|
||||
let superCtor = Object.getPrototypeOf(klass.prototype).constructor;
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_12.js:613: WARNING - Property $ never defined on this.root of type DocumentFragment
|
||||
this.$ = this.root.$;
|
||||
^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_12.js:743: WARNING - Property _parseTemplateContent never defined on polymerElementBase of type polymerElementBase<|function(new:polymerElementBase):?|>
|
||||
return super._parseTemplateContent(template, templateInfo, nodeInfo);
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_23.js:446: WARNING - Property forceRender never defined on any type in the program
|
||||
this.shadowRoot.forceRender();
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_27.js:118: WARNING - Property __dataHost never defined on this.__dataHost of type DataTemplate
|
||||
let templateHost = this.__dataHost.__dataHost;
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_27.js:190: WARNING - Property __dataHost never defined on model.__dataHost of type DataTemplate
|
||||
model = model.__dataHost.__dataHost;
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_27.js:232: WARNING - Property _bindTemplate never defined on klass.prototype of type klass.prototype
|
||||
klass.prototype._bindTemplate(template);
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_27.js:250: WARNING - Property _addPropertyEffect never defined on klass.prototype of type polymer_html_script_27$classdecl$var1.prototype
|
||||
klass.prototype._addPropertyEffect('_host_' + prop,
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_27.js:251: WARNING - Property PROPERTY_EFFECT_TYPES never defined on klass.prototype of type polymer_html_script_27$classdecl$var1.prototype
|
||||
klass.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE,
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_27.js:253: WARNING - Property _createNotifyingProperty never defined on klass.prototype of type polymer_html_script_27$classdecl$var1.prototype
|
||||
klass.prototype._createNotifyingProperty('_host_' + prop);
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_29.js:95: WARNING - Property $ never defined on this.root of type DocumentFragment
|
||||
this.$ = this.root.$;
|
||||
^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_31.js:218: WARNING - property _setRenderedItemCount not defined on any supertype of DomRepeat
|
||||
renderedItemCount: {
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_31.js:365: WARNING - Property __dataHost never defined on this of type DomRepeat
|
||||
return this.__dataHost._methodHost || this.__dataHost;
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_32.js:222: WARNING - Property __dataHost never defined on this of type DomIf{__instance: {_setPendingProperty: LOOSE_TOP_FUNCTION} (loose)}
|
||||
this.__instance._setPendingProperty(prop, this.__dataHost[prop]);
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_33.js:169: WARNING - The right side in the assignment is not a subtype of the left side.
|
||||
Expected : Object
|
||||
Found : null
|
||||
|
||||
this.selected = this.selectedItem = null;
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_33.js:169: WARNING - The right side in the assignment is not a subtype of the left side.
|
||||
Expected : Object
|
||||
Found : null
|
||||
|
||||
this.selected = this.selectedItem = null;
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_33.js:208: WARNING - The right side in the assignment is not a subtype of the left side.
|
||||
Expected : Object
|
||||
Found : Array<?>|null
|
||||
More details:
|
||||
The found type is a union that includes an unexpected type: null
|
||||
this.selected = this.multi ? [] : null
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_33.js:209: WARNING - The right side in the assignment is not a subtype of the left side.
|
||||
Expected : Object
|
||||
Found : null
|
||||
|
||||
this.selectedItem = null;
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_33.js:229: WARNING - Invalid type for index.
|
||||
Expected : number
|
||||
Found : *
|
||||
|
||||
polymer.html_script_33.js:228: WARNING - Property items never defined on this of type ArraySelectorMixin
|
||||
return this.isSelected(this.items[idx]);
|
||||
^^^^^^^^^^
|
||||
^^^
|
||||
|
||||
polymer.html_script_33.js:278: WARNING - Property items never defined on this of type ArraySelectorMixin
|
||||
this.deselect(this.items[idx]);
|
||||
^^^^^^^^^^
|
||||
polymer.html_script_33.js:268: WARNING - The right side in the assignment is not a subtype of the left side.
|
||||
Expected : Object
|
||||
Found : null
|
||||
|
||||
polymer.html_script_33.js:288: WARNING - Property items never defined on this of type ArraySelectorMixin
|
||||
this.selectIndex(this.items.indexOf(item));
|
||||
^^^^^^^^^^
|
||||
this.selected = this.selectedItem = null;
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_33.js:298: WARNING - Property items never defined on this of type ArraySelectorMixin
|
||||
let item = this.items[idx];
|
||||
^^^^^^^^^^
|
||||
polymer.html_script_33.js:268: WARNING - The right side in the assignment is not a subtype of the left side.
|
||||
Expected : Object
|
||||
Found : null
|
||||
|
||||
this.selected = this.selectedItem = null;
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
polymer.html_script_35.js:5: WARNING - Property _mutablePropertyChange never defined on Polymer.MutableData of type function(?):?
|
||||
let mutablePropertyChange = Polymer.MutableData._mutablePropertyChange;
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
0 error(s), 33 warning(s), 75.7% typed
|
||||
0 error(s), 61 warning(s), 75.7% typed
|
||||
|
||||
+15
-12
@@ -61,15 +61,18 @@ Polymer.sanitizeDOMValue;
|
||||
*/
|
||||
function JSCompiler_renameProperty(string, obj) {}
|
||||
|
||||
/** @record */
|
||||
function PolymerTelemetry(){}
|
||||
/** @type {number} */
|
||||
PolymerTelemetry.prototype.instanceCount;
|
||||
/** @type {Array<HTMLElement>} */
|
||||
PolymerTelemetry.prototype.registrations;
|
||||
/** @type {function(HTMLElement)} */
|
||||
PolymerTelemetry.prototype._regLog;
|
||||
/** @type {function(HTMLElement)} */
|
||||
PolymerTelemetry.prototype.register;
|
||||
/** @type {function(HTMLElement)} */
|
||||
PolymerTelemetry.prototype.dumpRegistrations;
|
||||
/** @type {Object} */
|
||||
Polymer.telemetry;
|
||||
|
||||
/** @type {Object} */
|
||||
Polymer_PropertyEffects.prototype.__computeEffects;
|
||||
/** @type {Object} */
|
||||
Polymer_PropertyEffects.prototype.__reflectEffects;
|
||||
/** @type {Object} */
|
||||
Polymer_PropertyEffects.prototype.__notifyEffects;
|
||||
/** @type {Object} */
|
||||
Polymer_PropertyEffects.prototype.__propagateEffects;
|
||||
/** @type {Object} */
|
||||
Polymer_PropertyEffects.prototype.__observeEffects;
|
||||
/** @type {Object} */
|
||||
Polymer_PropertyEffects.prototype.__readOnly;
|
||||
@@ -2,6 +2,7 @@
|
||||
* @fileoverview Externs for webcomponents polyfills
|
||||
* @externs
|
||||
*/
|
||||
/* eslint-disable */
|
||||
|
||||
let HTMLImports = {
|
||||
/**
|
||||
|
||||
+7
-3
@@ -107,6 +107,7 @@ gulp.task('closure', ['clean'], () => {
|
||||
}
|
||||
|
||||
config('polymer.html');
|
||||
// config('lib/mixins/property-effects.html');
|
||||
|
||||
const project = new PolymerProject({
|
||||
shell: `./${entry}`,
|
||||
@@ -146,6 +147,7 @@ gulp.task('closure', ['clean'], () => {
|
||||
rewrite_polyfills: false,
|
||||
new_type_inf: true,
|
||||
checks_only: CLOSURE_LINT_ONLY,
|
||||
polymer_version: 2,
|
||||
externs: [
|
||||
'bower_components/shadycss/externs/shadycss-externs.js',
|
||||
'externs/webcomponents-externs.js',
|
||||
@@ -153,9 +155,11 @@ gulp.task('closure', ['clean'], () => {
|
||||
'externs/polymer-externs.js',
|
||||
],
|
||||
extra_annotation_name: [
|
||||
'polymerMixin',
|
||||
'polymerMixinClass',
|
||||
'polymerElement'
|
||||
'appliesMixin',
|
||||
'mixinClass',
|
||||
'mixinFunction',
|
||||
'polymer',
|
||||
'customElement'
|
||||
]
|
||||
}, closurePluginOptions);
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
*
|
||||
* @mixinFunction
|
||||
* @polymer
|
||||
* @appliesMixin Polymer.ElementMixin
|
||||
* @memberof Polymer
|
||||
* @summary Element mixin for recording dynamic associations between item paths in a
|
||||
* master `items` array and a `selected` array
|
||||
@@ -48,6 +47,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
|
||||
/**
|
||||
* @mixinClass
|
||||
* @polymer
|
||||
* @implements {Polymer_ArraySelectorMixin}
|
||||
* @unrestricted
|
||||
*/
|
||||
|
||||
@@ -87,7 +87,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
/**
|
||||
* Forces the element to render its content. This is typically only
|
||||
* necessary to call if HTMLImports with the async attribute are used.
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
render() {
|
||||
let template;
|
||||
|
||||
@@ -230,7 +230,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
return true;
|
||||
}
|
||||
|
||||
/** @suppress {missingProperties} */
|
||||
__syncHostProperties() {
|
||||
let props = this.__invalidProps;
|
||||
if (props) {
|
||||
|
||||
@@ -118,7 +118,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* @polymer
|
||||
* @memberof Polymer
|
||||
* @extends {domRepeatBase}
|
||||
* @appliesMixin Polymer.MutableData
|
||||
* @appliesMixin Polymer.OptionalMutableData
|
||||
* @summary Custom element for stamping instance of a template bound to
|
||||
* items in an array.
|
||||
*/
|
||||
@@ -372,10 +372,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
return true;
|
||||
}
|
||||
|
||||
/* eslint-disable valid-jsdoc */
|
||||
/**
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
__getMethodHost() {
|
||||
// Technically this should be the owner of the outermost template.
|
||||
// In shadow dom, this is always getRootNode().host, but we can
|
||||
@@ -384,7 +380,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
// instance causing it to get a dataHost.
|
||||
return this.__dataHost._methodHost || this.__dataHost;
|
||||
}
|
||||
/* eslint-enable valid-jsdoc */
|
||||
|
||||
__sortChanged(sort) {
|
||||
let methodHost = this.__getMethodHost();
|
||||
|
||||
@@ -135,7 +135,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* @param {!PolymerInit} info Polymer info object
|
||||
* @param {!HTMLElement} Base base class to extend with info object
|
||||
* @return {!HTMLElement} Generated class
|
||||
* @suppress {missingProperties, checkTypes}
|
||||
* @suppress {checkTypes}
|
||||
* @private
|
||||
*/
|
||||
function GenerateClassFromInfo(info, Base) {
|
||||
@@ -151,7 +151,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
}
|
||||
|
||||
/**
|
||||
* @suppress {missingProperties}
|
||||
* @return {HTMLTemplateElement} template for this class
|
||||
*/
|
||||
static get template() {
|
||||
|
||||
@@ -459,7 +459,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* a user should call `distributeContent` if distribution has been
|
||||
* invalidated due to an element being added or removed from the shadowRoot
|
||||
* that contains an insertion point (`<slot>`) inside its subtree.
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
distributeContent() {
|
||||
if (window.ShadyDOM && this.shadowRoot) {
|
||||
|
||||
@@ -167,7 +167,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
*
|
||||
* @param {PolymerElementConstructor} klass Element class
|
||||
* @return {PolymerElementProperties} Flattened properties for this class
|
||||
* @suppress {missingProperties}
|
||||
* @private
|
||||
*/
|
||||
function propertiesForClass(klass) {
|
||||
@@ -626,7 +625,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* Stamps the element template.
|
||||
*
|
||||
* @override
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
ready() {
|
||||
if (this._template) {
|
||||
@@ -758,7 +756,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* created for them.
|
||||
*
|
||||
* @override
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
static _parseTemplateContent(template, templateInfo, nodeInfo) {
|
||||
templateInfo.dynamicFns = templateInfo.dynamicFns || propertiesForClass(this);
|
||||
@@ -790,9 +787,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
*/
|
||||
registrations: [],
|
||||
/**
|
||||
* @param {HTMLElement} prototype Element prototype to log
|
||||
* @param {!PolymerElementConstructor} prototype Element prototype to log
|
||||
* @private
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
_regLog: function(prototype) {
|
||||
console.log('[' + prototype.is + ']: registered')
|
||||
@@ -801,7 +797,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* Registers a class prototype for telemetry purposes.
|
||||
* @param {HTMLElement} prototype Element prototype to register
|
||||
* @protected
|
||||
* @this {PolymerTelemetry}
|
||||
* @this {this}
|
||||
*/
|
||||
register: function(prototype) {
|
||||
this.registrations.push(prototype);
|
||||
@@ -810,7 +806,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
/**
|
||||
* Logs all elements registered with an `is` to the console.
|
||||
* @public
|
||||
* @this {PolymerTelemetry}
|
||||
* @this {this}
|
||||
*/
|
||||
dumpRegistrations: function() {
|
||||
this.registrations.forEach(this._regLog);
|
||||
|
||||
@@ -100,7 +100,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
}
|
||||
|
||||
}
|
||||
/** @type boolean */
|
||||
/** @type {boolean} */
|
||||
MutableData.prototype.mutableData = false;
|
||||
|
||||
return MutableData;
|
||||
@@ -150,6 +150,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
|
||||
/**
|
||||
* @mixinClass
|
||||
* @polymer
|
||||
* @implements {Polymer_OptionalMutableData}
|
||||
*/
|
||||
class OptionalMutableData extends superClass {
|
||||
|
||||
@@ -119,6 +119,28 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
/** @type {boolean} */
|
||||
this.__serializing;
|
||||
/** @type {number} */
|
||||
this.__dataCounter;
|
||||
/** @type {boolean} */
|
||||
this.__dataEnabled;
|
||||
/** @type {boolean} */
|
||||
this.__dataReady;
|
||||
/** @type {boolean} */
|
||||
this.__dataInvalid;
|
||||
/** @type {!Object} */
|
||||
this.__data;
|
||||
/** @type {Object} */
|
||||
this.__dataPending;
|
||||
/** @type {Object} */
|
||||
this.__dataOld;
|
||||
/** @type {Object} */
|
||||
this.__dataProto;
|
||||
/** @type {Object} */
|
||||
this.__dataHasAccessor;
|
||||
/** @type {Object} */
|
||||
this.__dataInstanceProps;
|
||||
this._initializeProperties();
|
||||
}
|
||||
|
||||
@@ -452,7 +474,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
this.__dataOld = {};
|
||||
}
|
||||
// Ensure old is captured from the last turn
|
||||
if (!(property in this.__dataOld)) {
|
||||
if (this.__dataOld && !(property in this.__dataOld)) {
|
||||
this.__dataOld[property] = old;
|
||||
}
|
||||
this.__data[property] = value;
|
||||
@@ -469,7 +491,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* @protected
|
||||
*/
|
||||
_isPropertyPending(prop) {
|
||||
return this.__dataPending && (prop in this.__dataPending);
|
||||
return Boolean(this.__dataPending && (prop in this.__dataPending));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -519,7 +541,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* @protected
|
||||
*/
|
||||
_flushProperties() {
|
||||
if (this.__dataPending) {
|
||||
if (this.__dataPending && this.__dataOld) {
|
||||
let changedProps = this.__dataPending;
|
||||
this.__dataPending = null;
|
||||
this.__dataCounter++;
|
||||
|
||||
@@ -62,6 +62,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
*/
|
||||
let DataEffect; //eslint-disable-line no-unused-vars
|
||||
|
||||
let PropertyEffectsType; //eslint-disable-line no-unused-vars
|
||||
|
||||
/**
|
||||
* Ensures that the model has an own-property map of effects for the given type.
|
||||
* The model may be a prototype or an instance.
|
||||
@@ -107,7 +109,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* Runs all effects of a given type for the given set of property changes
|
||||
* on an instance.
|
||||
*
|
||||
* @param {!Polymer_PropertyEffects} inst The instance with effects to run
|
||||
* @param {!PropertyEffectsType} inst The instance with effects to run
|
||||
* @param {Object} effects Object map of property-to-Array of effects
|
||||
* @param {Object} props Bag of current property changes
|
||||
* @param {Object=} oldProps Bag of previous values for changed properties
|
||||
@@ -133,7 +135,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
/**
|
||||
* Runs a list of effects for a given property.
|
||||
*
|
||||
* @param {!Polymer_PropertyEffects} inst The instance with effects to run
|
||||
* @param {!PropertyEffectsType} inst The instance with effects to run
|
||||
* @param {Object} effects Object map of property-to-Array of effects
|
||||
* @param {number} dedupeId Counter used for de-duping effects
|
||||
* @param {string} prop Name of changed property
|
||||
@@ -198,12 +200,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* Calls the method with `info.methodName` on the instance, passing the
|
||||
* new and old values.
|
||||
*
|
||||
* @param {!Polymer_PropertyEffects} inst The instance the effect will be run on
|
||||
* @param {!PropertyEffectsType} inst The instance the effect will be run on
|
||||
* @param {string} property Name of property
|
||||
* @param {Object} props Bag of current property changes
|
||||
* @param {Object} oldProps Bag of previous values for changed properties
|
||||
* @param {?} info Effect metadata
|
||||
* @suppress {missingProperties}
|
||||
* @private
|
||||
*/
|
||||
function runObserverEffect(inst, property, props, oldProps, info) {
|
||||
@@ -226,12 +227,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* `notify: true` to ensure object sub-property notifications were
|
||||
* sent.
|
||||
*
|
||||
* @param {!Polymer_PropertyEffects} inst The instance with effects to run
|
||||
* @param {!PropertyEffectsType} inst The instance with effects to run
|
||||
* @param {Object} notifyProps Bag of properties to notify
|
||||
* @param {Object} props Bag of current property changes
|
||||
* @param {Object} oldProps Bag of previous values for changed properties
|
||||
* @param {boolean} hasPaths True with `props` contains one or more paths
|
||||
* @suppress {missingProperties}
|
||||
* @private
|
||||
*/
|
||||
function runNotifyEffects(inst, notifyProps, props, oldProps, hasPaths) {
|
||||
@@ -262,7 +262,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* Dispatches {property}-changed events with path information in the detail
|
||||
* object to indicate a sub-path of the property was changed.
|
||||
*
|
||||
* @param {!Polymer_PropertyEffects} inst The element from which to fire the event
|
||||
* @param {!PropertyEffectsType} inst The element from which to fire the event
|
||||
* @param {string} path The path that was changed
|
||||
* @param {Object} props Bag of current property changes
|
||||
* @return {boolean} Returns true if the path was notified
|
||||
@@ -282,7 +282,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* Dispatches {property}-changed events to indicate a property (or path)
|
||||
* changed.
|
||||
*
|
||||
* @param {!Polymer_PropertyEffects} inst The element from which to fire the event
|
||||
* @param {!PropertyEffectsType} inst The element from which to fire the event
|
||||
* @param {string} eventName The name of the event to send ('{property}-changed')
|
||||
* @param {*} value The value of the changed property
|
||||
* @param {string | null | undefined} path If a sub-path of this property changed, the path
|
||||
@@ -307,13 +307,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* Dispatches a non-bubbling event named `info.eventName` on the instance
|
||||
* with a detail object containing the new `value`.
|
||||
*
|
||||
* @param {!Polymer_PropertyEffects} inst The instance the effect will be run on
|
||||
* @param {!PropertyEffectsType} inst The instance the effect will be run on
|
||||
* @param {string} property Name of property
|
||||
* @param {Object} props Bag of current property changes
|
||||
* @param {Object} oldProps Bag of previous values for changed properties
|
||||
* @param {?} info Effect metadata
|
||||
* @param {boolean} hasPaths True with `props` contains one or more paths
|
||||
* @suppress {missingProperties}
|
||||
* @private
|
||||
*/
|
||||
function runNotifyEffect(inst, property, props, oldProps, info, hasPaths) {
|
||||
@@ -336,7 +335,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* scope's name for that path first.
|
||||
*
|
||||
* @param {CustomEvent} event Notification event (e.g. '<property>-changed')
|
||||
* @param {!Polymer_PropertyEffects} inst Host element instance handling the notification event
|
||||
* @param {!PropertyEffectsType} inst Host element instance handling the notification event
|
||||
* @param {string} fromProp Child element property that was bound
|
||||
* @param {string} toPath Host property/path that was bound
|
||||
* @param {boolean} negate Whether the binding was negated
|
||||
@@ -366,12 +365,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
*
|
||||
* Sets the attribute named `info.attrName` to the given property value.
|
||||
*
|
||||
* @param {!Polymer_PropertyEffects} inst The instance the effect will be run on
|
||||
* @param {!PropertyEffectsType} inst The instance the effect will be run on
|
||||
* @param {string} property Name of property
|
||||
* @param {Object} props Bag of current property changes
|
||||
* @param {Object} oldProps Bag of previous values for changed properties
|
||||
* @param {?} info Effect metadata
|
||||
* @suppress {missingProperties}
|
||||
* @private
|
||||
*/
|
||||
function runReflectEffect(inst, property, props, oldProps, info) {
|
||||
@@ -392,12 +390,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* computed before other effects (binding propagation, observers, and notify)
|
||||
* run.
|
||||
*
|
||||
* @param {!Polymer_PropertyEffects} inst The instance the effect will be run on
|
||||
* @param {!PropertyEffectsType} inst The instance the effect will be run on
|
||||
* @param {!Object} changedProps Bag of changed properties
|
||||
* @param {!Object} oldProps Bag of previous values for changed properties
|
||||
* @param {boolean} hasPaths True with `props` contains one or more paths
|
||||
* @private
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
function runComputedEffects(inst, changedProps, oldProps, hasPaths) {
|
||||
let computeEffects = inst.__computeEffects;
|
||||
@@ -417,7 +414,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* values of the arguments specified in the `info` object and setting the
|
||||
* return value to the computed property specified.
|
||||
*
|
||||
* @param {!Polymer_PropertyEffects} inst The instance the effect will be run on
|
||||
* @param {!PropertyEffectsType} inst The instance the effect will be run on
|
||||
* @param {string} property Name of property
|
||||
* @param {Object} props Bag of current property changes
|
||||
* @param {Object} oldProps Bag of previous values for changed properties
|
||||
@@ -438,11 +435,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* Computes path changes based on path links set up using the `linkPaths`
|
||||
* API.
|
||||
*
|
||||
* @param {!Polymer_PropertyEffects} inst The instance whose props are changing
|
||||
* @param {!PropertyEffectsType} inst The instance whose props are changing
|
||||
* @param {string | !Array<(string|number)>} path Path that has changed
|
||||
* @param {*} value Value of changed path
|
||||
* @private
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
function computeLinkedPaths(inst, path, value) {
|
||||
let links = inst.__dataLinkedPaths;
|
||||
@@ -478,7 +474,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* only for 'property' bindings, since these must be initialized as part
|
||||
* of boot-up)
|
||||
* @private
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
function addBinding(constructor, templateInfo, nodeInfo, kind, target, parts, literal) {
|
||||
// Create binding metadata and add to nodeInfo
|
||||
@@ -510,7 +505,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* @param {Object} binding Binding metadata
|
||||
* @param {Object} part Binding part metadata
|
||||
* @param {number} index Index into `nodeInfoList` for this node
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
function addEffectForBindingPart(constructor, templateInfo, binding, part, index) {
|
||||
if (!part.literal) {
|
||||
@@ -544,7 +538,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* there is no support for _path_ bindings via custom binding parts,
|
||||
* as this is specific to Polymer's path binding syntax.
|
||||
*
|
||||
* @param {!Polymer_PropertyEffects} inst The instance the effect will be run on
|
||||
* @param {!PropertyEffectsType} inst The instance the effect will be run on
|
||||
* @param {string} path Name of property
|
||||
* @param {Object} props Bag of current property changes
|
||||
* @param {Object} oldProps Bag of previous values for changed properties
|
||||
@@ -579,12 +573,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* Sets the value for an "binding" (binding) effect to a node,
|
||||
* either as a property or attribute.
|
||||
*
|
||||
* @param {!Polymer_PropertyEffects} inst The instance owning the binding effect
|
||||
* @param {!PropertyEffectsType} inst The instance owning the binding effect
|
||||
* @param {Node} node Target node for binding
|
||||
* @param {Object} binding Binding metadata
|
||||
* @param {Object} part Binding part metadata
|
||||
* @param {*} value Value to set
|
||||
* @suppress {missingProperties}
|
||||
* @private
|
||||
*/
|
||||
function applyBindingValue(inst, node, binding, part, value) {
|
||||
@@ -620,7 +613,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* @param {Object} part Binding part metadata
|
||||
* @return {*} Transformed value to set
|
||||
* @private
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
function computeBindingValue(node, value, binding, part) {
|
||||
if (binding.isCompound) {
|
||||
@@ -663,10 +655,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* Setup compound binding storage structures, notify listeners, and dataHost
|
||||
* references onto the bound nodeList.
|
||||
*
|
||||
* @param {!Polymer_PropertyEffects} inst Instance that bas been previously bound
|
||||
* @param {!PropertyEffectsType} inst Instance that bas been previously bound
|
||||
* @param {Object} templateInfo Template metadata
|
||||
* @private
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
function setupBindings(inst, templateInfo) {
|
||||
// Setup compound storage, dataHost, and notify listeners
|
||||
@@ -725,7 +716,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* Adds a 2-way binding notification event listener to the node specified
|
||||
*
|
||||
* @param {Object} node Child element to add listener to
|
||||
* @param {!Polymer_PropertyEffects} inst Host element instance to handle notification event
|
||||
* @param {!PropertyEffectsType} inst Host element instance to handle notification event
|
||||
* @param {Object} binding Binding metadata
|
||||
* @private
|
||||
*/
|
||||
@@ -755,7 +746,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* method names should be included as a dependency to the effect. Note,
|
||||
* defaults to true if the signature is static (sig.static is true).
|
||||
* @private
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
function createMethodEffect(model, sig, type, effectFn, methodInfo, dynamicFn) {
|
||||
dynamicFn = sig.static || (dynamicFn &&
|
||||
@@ -788,13 +778,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* functions call this function to invoke the method, then use the return
|
||||
* value accordingly.
|
||||
*
|
||||
* @param {!Polymer_PropertyEffects} inst The instance the effect will be run on
|
||||
* @param {!PropertyEffectsType} inst The instance the effect will be run on
|
||||
* @param {string} property Name of property
|
||||
* @param {Object} props Bag of current property changes
|
||||
* @param {Object} oldProps Bag of previous values for changed properties
|
||||
* @param {?} info Effect metadata
|
||||
* @return {*} Returns the return value from the method invocation
|
||||
* @suppress {missingProperties}
|
||||
* @private
|
||||
*/
|
||||
function runMethodEffect(inst, property, props, oldProps, info) {
|
||||
@@ -965,7 +954,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* @param {Object} props Bag of current property changes
|
||||
* @return {Array<*>} Array of argument values
|
||||
* @private
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
function marshalArgs(data, args, path, props) {
|
||||
let values = [];
|
||||
@@ -1010,12 +998,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
*
|
||||
* Note: this implementation only accepts normalized paths
|
||||
*
|
||||
* @param {!Polymer_PropertyEffects} inst Instance to send notifications to
|
||||
* @param {!PropertyEffectsType} inst Instance to send notifications to
|
||||
* @param {Array} array The array the mutations occurred on
|
||||
* @param {string} path The path to the array that was mutated
|
||||
* @param {Array} splices Array of splice records
|
||||
* @private
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
function notifySplices(inst, array, path, splices) {
|
||||
let splicesPath = path + '.splices';
|
||||
@@ -1031,7 +1018,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
*
|
||||
* Note: this implementation only accepts normalized paths
|
||||
*
|
||||
* @param {!Polymer_PropertyEffects} inst Instance to send notifications to
|
||||
* @param {!PropertyEffectsType} inst Instance to send notifications to
|
||||
* @param {Array} array The array the mutations occurred on
|
||||
* @param {string} path The path to the array that was mutated
|
||||
* @param {number} index Index at which the array mutation occurred
|
||||
@@ -1115,6 +1102,46 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
*/
|
||||
class PropertyEffects extends propertyEffectsBase {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
/** @type {boolean} */
|
||||
this.__dataClientsReady;
|
||||
/** @type {Array} */
|
||||
this.__dataPendingClients;
|
||||
/** @type {Object} */
|
||||
this.__dataToNotify;
|
||||
/** @type {Object} */
|
||||
this.__dataLinkedPaths;
|
||||
/** @type {boolean} */
|
||||
this.__dataHasPaths;
|
||||
/** @type {Object} */
|
||||
this.__dataCompoundStorage;
|
||||
/** @type {Object} */
|
||||
this.__dataHost;
|
||||
/** @type {!Object} */
|
||||
this.__dataTemp;
|
||||
/** @type {boolean} */
|
||||
this.__dataClientsInitialized;
|
||||
/** @type {!Object} */
|
||||
this.__data;
|
||||
/** @type {!Object} */
|
||||
this.__dataPending;
|
||||
/** @type {!Object} */
|
||||
this.__dataOld;
|
||||
/** @type {Object} */
|
||||
this.__computeEffects;
|
||||
/** @type {Object} */
|
||||
this.__reflectEffects;
|
||||
/** @type {Object} */
|
||||
this.__notifyEffects;
|
||||
/** @type {Object} */
|
||||
this.__propagateEffects;
|
||||
/** @type {Object} */
|
||||
this.__observeEffects;
|
||||
/** @type {Object} */
|
||||
this.__readOnly;
|
||||
}
|
||||
|
||||
get PROPERTY_EFFECT_TYPES() {
|
||||
return TYPES;
|
||||
}
|
||||
@@ -1154,7 +1181,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
*
|
||||
* @override
|
||||
* @param {Object} props Properties to initialize on the instance
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
_initializeInstanceProperties(props) {
|
||||
let readOnly = this.__readOnly;
|
||||
@@ -1584,7 +1610,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* a specific order (compute, propagate, reflect, observe, notify).
|
||||
*
|
||||
* @override
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
_propertiesChanged(currentProps, changedProps, oldProps) {
|
||||
// ----------------------------
|
||||
@@ -1701,7 +1726,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* reported in index order (raw results from `Object.observe` are not
|
||||
* ordered and must be normalized/merged before notifying).
|
||||
* @public
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
notifySplices(path, splices) {
|
||||
let info = {};
|
||||
@@ -1777,7 +1801,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* @param {...*} items Items to push onto array
|
||||
* @return {number} New length of the array.
|
||||
* @public
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
push(path, ...items) {
|
||||
let info = {};
|
||||
@@ -1802,7 +1825,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* @param {string} path Path to array.
|
||||
* @return {*} Item that was removed.
|
||||
* @public
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
pop(path) {
|
||||
let info = {};
|
||||
@@ -1831,7 +1853,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* @param {...*} items Items to insert into array.
|
||||
* @return {Array} Array of removed items.
|
||||
* @public
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
splice(path, start, deleteCount, ...items) {
|
||||
let info = {};
|
||||
@@ -1864,7 +1885,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* @param {string} path Path to array.
|
||||
* @return {*} Item that was removed.
|
||||
* @public
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
shift(path) {
|
||||
let info = {};
|
||||
@@ -1890,7 +1910,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* @param {...*} items Items to insert info array
|
||||
* @return {number} New length of the array.
|
||||
* @public
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
unshift(path, ...items) {
|
||||
let info = {};
|
||||
@@ -1913,7 +1932,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* @param {string} path Path that should be notified.
|
||||
* @param {*=} value Value at the path (optional).
|
||||
* @public
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
notifyPath(path, value) {
|
||||
/** @type {string} */
|
||||
@@ -2284,7 +2302,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
*
|
||||
* @param {HTMLTemplateElement} template Template to stamp
|
||||
* @return {DocumentFragment} Cloned template content
|
||||
* @suppress {missingProperties}
|
||||
* @protected
|
||||
*/
|
||||
_stampTemplate(template) {
|
||||
@@ -2320,7 +2337,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
*
|
||||
* @param {DocumentFragment} dom DocumentFragment previously returned
|
||||
* from `_stampTemplate` associated with the nodes to be removed
|
||||
* @suppress {missingProperties}
|
||||
* @protected
|
||||
*/
|
||||
_removeBoundDom(dom) {
|
||||
@@ -2361,7 +2377,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* @return {boolean} `true` if the visited node added node-specific
|
||||
* metadata to `nodeInfo`
|
||||
* @protected
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
static _parseTemplateNode(node, templateInfo, nodeInfo) {
|
||||
let noted = super._parseTemplateNode(node, templateInfo, nodeInfo);
|
||||
@@ -2394,7 +2409,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* @return {boolean} `true` if the visited node added node-specific
|
||||
* metadata to `nodeInfo`
|
||||
* @protected
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
static _parseTemplateNodeAttribute(node, templateInfo, nodeInfo, name, value) {
|
||||
let parts = this._parseBindings(value, templateInfo);
|
||||
@@ -2446,7 +2460,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* @return {boolean} `true` if the visited node added node-specific
|
||||
* metadata to `nodeInfo`
|
||||
* @protected
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
static _parseTemplateNestedTemplate(node, templateInfo, nodeInfo) {
|
||||
let noted = super._parseTemplateNestedTemplate(node, templateInfo, nodeInfo);
|
||||
@@ -2492,7 +2505,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* @param {Object} templateInfo Current template metadata
|
||||
* @return {Array<Object>} Array of binding part metadata
|
||||
* @protected
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
static _parseBindings(text, templateInfo) {
|
||||
let parts = [];
|
||||
@@ -2574,7 +2586,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* @param {boolean} hasPaths True with `props` contains one or more paths
|
||||
* @return {*} Value the binding part evaluated to
|
||||
* @protected
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
static _evaluateBinding(inst, part, path, props, oldProps, hasPaths) {
|
||||
let value;
|
||||
@@ -2597,6 +2608,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
|
||||
}
|
||||
|
||||
PropertyEffectsType = PropertyEffects;
|
||||
|
||||
return PropertyEffects;
|
||||
});
|
||||
|
||||
|
||||
@@ -117,7 +117,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
}
|
||||
/**
|
||||
* @override
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
_addEventListenerToNode(node, eventName, handler) {
|
||||
if (this._methodHost && this.__templatizeOptions.parentModel) {
|
||||
@@ -193,7 +192,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
* or else the host element.
|
||||
*
|
||||
* @return {Polymer_PropertyEffects} The parent model of this instance
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
get parentModel() {
|
||||
let model = this.__parentModel;
|
||||
@@ -238,10 +236,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
return templateHost && templateHost._methodHost || templateHost;
|
||||
}
|
||||
|
||||
/* eslint-disable valid-jsdoc */
|
||||
/**
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
function createTemplatizerClass(template, templateInfo, options) {
|
||||
// Anonymous class created by the templatize
|
||||
let base = options.mutableData ?
|
||||
@@ -253,12 +247,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
addNotifyEffects(klass, template, templateInfo, options);
|
||||
return klass;
|
||||
}
|
||||
/* eslint-enable valid-jsdoc */
|
||||
|
||||
/* eslint-disable valid-jsdoc */
|
||||
/**
|
||||
* @suppress {missingProperties}
|
||||
*/
|
||||
function addPropagateEffects(template, templateInfo, options) {
|
||||
let userForwardHostProp = options.forwardHostProp;
|
||||
if (userForwardHostProp) {
|
||||
@@ -293,7 +282,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
template._enableProperties();
|
||||
}
|
||||
}
|
||||
/* eslint-enable valid-jsdoc */
|
||||
|
||||
function createForwardHostPropEffect(hostProp, userForwardHostProp) {
|
||||
return function forwardHostProp(template, prop, props) {
|
||||
|
||||
Reference in New Issue
Block a user