From a2fa1005de69bfa841c9cc44a72e17f7487944a2 Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Mon, 17 Apr 2017 11:58:13 -0700 Subject: [PATCH] lint and compile successfully --- externs/closure-types.js | 141 ++++++++++++++++-------- externs/polymer-externs.js | 2 +- gulpfile.js | 2 - lib/elements/array-selector.html | 7 +- lib/legacy/legacy-element-mixin.html | 7 +- lib/mixins/element-mixin.html | 7 +- lib/mixins/gesture-event-listeners.html | 7 +- lib/mixins/mutable-data.html | 14 +-- lib/mixins/property-accessors.html | 7 +- lib/mixins/property-effects.html | 7 +- lib/mixins/template-stamp.html | 7 +- lib/utils/boot.html | 5 +- 12 files changed, 112 insertions(+), 101 deletions(-) diff --git a/externs/closure-types.js b/externs/closure-types.js index b64842134a..eadc31f64a 100644 --- a/externs/closure-types.js +++ b/externs/closure-types.js @@ -5,7 +5,7 @@ * * This file is generated, do not edit manually */ -/* eslint-disable no-unused-vars */ +/* eslint-disable no-unused-vars, strict */ /** * @record @@ -19,6 +19,10 @@ Polymer_PropertyAccessors.prototype._initializeProperties = function(){}; */ Polymer_PropertyAccessors.prototype._initializeProtoProperties = function(props){}; /** +* @param {Object} props +*/ +Polymer_PropertyAccessors.prototype._initializeInstanceProperties = function(props){}; +/** * @param {string} attribute * @param {string} value */ @@ -59,12 +63,18 @@ Polymer_PropertyAccessors.prototype._deserializeValue = function(value, type){}; Polymer_PropertyAccessors.prototype._createPropertyAccessor = function(property, readOnly){}; /** * @param {string} property +* @return {boolean} +*/ +Polymer_PropertyAccessors.prototype._hasAccessor = function(property){}; +/** +* @param {string} property * @param {*} value */ Polymer_PropertyAccessors.prototype._setProperty = function(property, value){}; /** * @param {string} property * @param {*} value +* @return {boolean} */ Polymer_PropertyAccessors.prototype._setPendingProperty = function(property, value){}; /** @@ -79,6 +89,9 @@ Polymer_PropertyAccessors.prototype._invalidateProperties = function(){}; */ Polymer_PropertyAccessors.prototype._flushProperties = function(){}; /** +*/ +Polymer_PropertyAccessors.prototype.ready = function(){}; +/** * @param {Object} currentProps * @param {Object} changedProps * @param {Object} oldProps @@ -96,30 +109,31 @@ Polymer_PropertyAccessors.prototype._shouldPropertyChange = function(property, v */ function Polymer_TemplateStamp(){} /** -* @param {HTMLTemplateElement} template */ -Polymer_TemplateStamp.prototype._stampTemplate = function(template){}; +Polymer_TemplateStamp.prototype._initializeProperties = function(){}; /** -* @param {*} template +* @param {HTMLTemplateElement} template +* @return {DocumentFragment} */ -Polymer_TemplateStamp.prototype._parseTemplateAnnotations = function(template){}; +Polymer_TemplateStamp.prototype._stampTemplate = function(template){}; /** -* @param {*} node -* @param {*} eventName -* @param {*} methodName -* @param {*} context +* @param {Node} node +* @param {string} eventName +* @param {string} methodName +* @param {*=} context +* @return {Function} */ Polymer_TemplateStamp.prototype._addMethodEventListenerToNode = function(node, eventName, methodName, context){}; /** -* @param {*} node -* @param {*} eventName -* @param {*} handler +* @param {Node} node +* @param {string} eventName +* @param {Function} handler */ Polymer_TemplateStamp.prototype._addEventListenerToNode = function(node, eventName, handler){}; /** -* @param {*} node -* @param {*} eventName -* @param {*} handler +* @param {Node} node +* @param {string} eventName +* @param {Function} handler */ Polymer_TemplateStamp.prototype._removeEventListenerFromNode = function(node, eventName, handler){}; /** @@ -129,20 +143,33 @@ Polymer_TemplateStamp.prototype._removeEventListenerFromNode = function(node, ev */ function Polymer_PropertyEffects(){} /** +* @override */ Polymer_PropertyEffects.prototype._initializeProperties = function(){}; /** +* @override * @param {*} props */ Polymer_PropertyEffects.prototype._initializeProtoProperties = function(props){}; /** -* @param {*} property +* @override +* @param {*} props +*/ +Polymer_PropertyEffects.prototype._initializeInstanceProperties = function(props){}; +/** +* @param {string} property * @param {string} type * @param {Object=} effect */ Polymer_PropertyEffects.prototype._addPropertyEffect = function(property, type, effect){}; /** * @param {string} property +* @param {string} type +* @param {Object=} effect +*/ +Polymer_PropertyEffects.prototype._removePropertyEffect = function(property, type, effect){}; +/** +* @param {string} property * @param {string=} type * @return {boolean} */ @@ -170,7 +197,7 @@ Polymer_PropertyEffects.prototype._hasComputedEffect = function(property){}; /** * @param {(string|!Array.<(number|string)>)} path * @param {*} value -* @param {*} shouldNotify +* @param {boolean=} shouldNotify * @param {boolean=} isPathNotification * @return {boolean} */ @@ -182,17 +209,20 @@ Polymer_PropertyEffects.prototype._setPendingPropertyOrPath = function(path, val */ Polymer_PropertyEffects.prototype._setUnmanagedPropertyToNode = function(node, prop, value){}; /** +* @override * @param {*} property * @param {*} value * @param {*} shouldNotify */ Polymer_PropertyEffects.prototype._setPendingProperty = function(property, value, shouldNotify){}; /** +* @override * @param {*} property * @param {*} value */ Polymer_PropertyEffects.prototype._setProperty = function(property, value){}; /** +* @override */ Polymer_PropertyEffects.prototype._invalidateProperties = function(){}; /** @@ -204,29 +234,30 @@ Polymer_PropertyEffects.prototype._enqueueClient = function(client){}; Polymer_PropertyEffects.prototype._flushClients = function(){}; /** * @param {Object} props +* @param {boolean=} setReadOnly */ -Polymer_PropertyEffects.prototype.setProperties = function(props){}; -/** -*/ -Polymer_PropertyEffects.prototype._flushProperties = function(){}; +Polymer_PropertyEffects.prototype.setProperties = function(props, setReadOnly){}; /** +* @override */ Polymer_PropertyEffects.prototype.ready = function(){}; /** */ Polymer_PropertyEffects.prototype._readyClients = function(){}; /** -* @param {HTMLTemplateElement} template -* @return {DocumentFragment} -*/ -Polymer_PropertyEffects.prototype._stampTemplate = function(template){}; -/** +* @override * @param {*} currentProps * @param {*} changedProps * @param {*} oldProps */ Polymer_PropertyEffects.prototype._propertiesChanged = function(currentProps, changedProps, oldProps){}; /** +* @param {Object} changedProps +* @param {Object} oldProps +* @param {boolean} hasPaths +*/ +Polymer_PropertyEffects.prototype._propagatePropertyChanges = function(changedProps, oldProps, hasPaths){}; +/** * @param {(string|!Array.<(string|number)>)} to * @param {(string|!Array.<(string|number)>)} from */ @@ -319,24 +350,42 @@ Polymer_PropertyEffects.prototype._createReflectedProperty = function(property){ Polymer_PropertyEffects.prototype._createComputedProperty = function(property, expression, dynamicFns){}; /** * @param {HTMLTemplateElement} template -* @param {Object=} dynamicFns +* @param {boolean=} instanceBinding +* @return {Object} */ -Polymer_PropertyEffects.prototype._bindTemplate = function(template, dynamicFns){}; +Polymer_PropertyEffects.prototype._bindTemplate = function(template, instanceBinding){}; +/** +* @param {HTMLTemplateElement} template +* @return {DocumentFragment} +*/ +Polymer_PropertyEffects.prototype._stampTemplate = function(template){}; +/** +* @param {DocumentFragment} dom +*/ +Polymer_PropertyEffects.prototype._removeBoundDom = function(dom){}; /** * @record * @extends {Polymer_PropertyEffects} */ function Polymer_ElementMixin(){} /** +* @override */ Polymer_ElementMixin.prototype._initializeProperties = function(){}; /** +* @override */ Polymer_ElementMixin.prototype.connectedCallback = function(){}; /** +* @override */ Polymer_ElementMixin.prototype.disconnectedCallback = function(){}; /** +* @override +*/ +Polymer_ElementMixin.prototype.ready = function(){}; +/** +* @override */ Polymer_ElementMixin.prototype._readyClients = function(){}; /** @@ -345,6 +394,7 @@ Polymer_ElementMixin.prototype._readyClients = function(){}; */ Polymer_ElementMixin.prototype._attachDom = function(dom){}; /** +* @override * @param {*} name * @param {*} old * @param {*} value @@ -395,12 +445,14 @@ Polymer_LegacyElementMixin.prototype.detached = function(){}; */ Polymer_LegacyElementMixin.prototype.attributeChanged = function(){}; /** +* @override */ Polymer_LegacyElementMixin.prototype._initializeProperties = function(){}; /** */ Polymer_LegacyElementMixin.prototype._registered = function(){}; /** +* @override */ Polymer_LegacyElementMixin.prototype.ready = function(){}; /** @@ -417,6 +469,7 @@ Polymer_LegacyElementMixin.prototype.serialize = function(value){}; /** * @param {string} value * @param {*} type +* @return {*} */ Polymer_LegacyElementMixin.prototype.deserialize = function(value, type){}; /** @@ -444,10 +497,11 @@ Polymer_LegacyElementMixin.prototype.extend = function(prototype, api){}; */ Polymer_LegacyElementMixin.prototype.mixin = function(target, source){}; /** -* @param {*} object -* @param {*} inherited +* @param {Object} object +* @param {Object} prototype +* @return {Object} */ -Polymer_LegacyElementMixin.prototype.chainObject = function(object, inherited){}; +Polymer_LegacyElementMixin.prototype.chainObject = function(object, prototype){}; /** * @param {HTMLTemplateElement} template * @return {DocumentFragment} @@ -473,7 +527,7 @@ Polymer_LegacyElementMixin.prototype.listen = function(node, eventName, methodNa */ Polymer_LegacyElementMixin.prototype.unlisten = function(node, eventName, methodName){}; /** -* @param {String=} direction +* @param {string=} direction * @param {HTMLElement=} node */ Polymer_LegacyElementMixin.prototype.setScrollDirection = function(direction, node){}; @@ -513,18 +567,18 @@ Polymer_LegacyElementMixin.prototype.queryEffectiveChildren = function(selector) */ Polymer_LegacyElementMixin.prototype.queryAllEffectiveChildren = function(selector){}; /** -* @param {String=} slctr +* @param {string=} slctr * @return {Array.} */ Polymer_LegacyElementMixin.prototype.getContentChildNodes = function(slctr){}; /** -* @param {String=} slctr +* @param {string=} slctr * @return {Array.} */ Polymer_LegacyElementMixin.prototype.getContentChildren = function(slctr){}; /** * @param {?Node} node -* @return {Boolean} +* @return {boolean} */ Polymer_LegacyElementMixin.prototype.isLightDescendant = function(node){}; /** @@ -538,27 +592,28 @@ Polymer_LegacyElementMixin.prototype.isLocalDescendant = function(node){}; */ Polymer_LegacyElementMixin.prototype.scopeSubtree = function(container, shouldObserve){}; /** -* @param {String} property -* @return {String} +* @param {string} property +* @return {string} */ Polymer_LegacyElementMixin.prototype.getComputedStyleValue = function(property){}; /** -* @param {String} jobName +* @param {string} jobName * @param {function ()} callback * @param {number} wait +* @return {Object} */ Polymer_LegacyElementMixin.prototype.debounce = function(jobName, callback, wait){}; /** -* @param {String} jobName +* @param {string} jobName * @return {boolean} */ Polymer_LegacyElementMixin.prototype.isDebouncerActive = function(jobName){}; /** -* @param {String} jobName +* @param {string} jobName */ Polymer_LegacyElementMixin.prototype.flushDebouncer = function(jobName){}; /** -* @param {String} jobName +* @param {string} jobName */ Polymer_LegacyElementMixin.prototype.cancelDebouncer = function(jobName){}; /** @@ -592,13 +647,13 @@ Polymer_LegacyElementMixin.prototype.importHref = function(href, onload, onerror */ Polymer_LegacyElementMixin.prototype.elementMatches = function(selector, node){}; /** -* @param {String} name +* @param {string} name * @param {boolean=} bool * @param {HTMLElement=} node */ Polymer_LegacyElementMixin.prototype.toggleAttribute = function(name, bool, node){}; /** -* @param {String} name +* @param {string} name * @param {boolean=} bool * @param {HTMLElement=} node */ diff --git a/externs/polymer-externs.js b/externs/polymer-externs.js index b0fb6dba2b..7305e11caf 100644 --- a/externs/polymer-externs.js +++ b/externs/polymer-externs.js @@ -5,7 +5,7 @@ /** * @param {!{is: string}} init - * @return {!CustomElement} + * @return {!HTMLElement} */ function Polymer(init){} diff --git a/gulpfile.js b/gulpfile.js index 906d31e35e..97b6464987 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -119,7 +119,6 @@ gulp.task('closure', ['clean'], () => { rewrite_polyfills: false, new_type_inf: true, externs: [ - // 'externs/closure-upstream-externs.js', 'externs/webcomponents-externs.js', 'externs/polymer-externs.js', 'externs/closure-types.js', @@ -180,7 +179,6 @@ gulp.task('closure', ['clean'], () => { .pipe(project.bundler()) .pipe(new Uniq()) .pipe(splitter.split()) - .pipe(new Log('saw:')) .pipe(gulpif(splitRx, closurePipeline())) .pipe(splitter.rejoin()) .pipe(gulpif(joinRx, minimalDocument())) diff --git a/lib/elements/array-selector.html b/lib/elements/array-selector.html index b020b23a00..88d28f1cbe 100644 --- a/lib/elements/array-selector.html +++ b/lib/elements/array-selector.html @@ -33,12 +33,7 @@ * @polymerMixin * @memberof Polymer */ - let ArraySelectorMixin = Polymer.dedupingMixin( - /** - * @template T - * @param {function(new:T)} superClass - */ - function(superClass) { + let ArraySelectorMixin = Polymer.dedupingMixin(superClass => { /** * @polymerMixinClass diff --git a/lib/legacy/legacy-element-mixin.html b/lib/legacy/legacy-element-mixin.html index 6555392ed2..ab19527828 100644 --- a/lib/legacy/legacy-element-mixin.html +++ b/lib/legacy/legacy-element-mixin.html @@ -38,12 +38,7 @@ * @memberof Polymer * @summary Element class mixin that provides Polymer's "legacy" API */ - Polymer.LegacyElementMixin = Polymer.dedupingMixin( - /** - * @template T - * @param {function(new:T)} base - */ - function(base) { + Polymer.LegacyElementMixin = Polymer.dedupingMixin(base => { /** * @constructor diff --git a/lib/mixins/element-mixin.html b/lib/mixins/element-mixin.html index 3d3739481c..2c4b0f0100 100644 --- a/lib/mixins/element-mixin.html +++ b/lib/mixins/element-mixin.html @@ -113,12 +113,7 @@ * @summary Element class mixin that provides the core API for Polymer's * meta-programming features. */ - Polymer.ElementMixin = Polymer.dedupingMixin( - /** - * @template T - * @param {function(new:T)} base - */ - function(base) { + Polymer.ElementMixin = Polymer.dedupingMixin(base => { /** * @constructor diff --git a/lib/mixins/gesture-event-listeners.html b/lib/mixins/gesture-event-listeners.html index 7342df39b0..abd8eae711 100644 --- a/lib/mixins/gesture-event-listeners.html +++ b/lib/mixins/gesture-event-listeners.html @@ -31,12 +31,7 @@ * @summary Element class mixin that provides API for adding Polymer's cross-platform * gesture events to nodes */ - Polymer.GestureEventListeners = Polymer.dedupingMixin( - /** - * @template T - * @param {function(new:T)} superClass - */ - function(superClass) { + Polymer.GestureEventListeners = Polymer.dedupingMixin(superClass => { /** * @polymerMixinClass diff --git a/lib/mixins/mutable-data.html b/lib/mixins/mutable-data.html index 92d75f0261..8e090fed3c 100644 --- a/lib/mixins/mutable-data.html +++ b/lib/mixins/mutable-data.html @@ -70,12 +70,7 @@ * @summary Element class mixin to skip strict dirty-checking for objects * and arrays */ - Polymer.MutableData = Polymer.dedupingMixin( - /** - * @template T - * @param {function(new:T)} superClass - */ - function(superClass) { + Polymer.MutableData = Polymer.dedupingMixin(superClass => { /** * @polymerMixinClass @@ -144,12 +139,7 @@ * @summary Element class mixin to optionally skip strict dirty-checking * for objects and arrays */ - Polymer.OptionalMutableData = Polymer.dedupingMixin( - /** - * @template T - * @param {function(new:T)} superClass - */ - function(superClass) { + Polymer.OptionalMutableData = Polymer.dedupingMixin(superClass => { /** * @polymerMixinClass diff --git a/lib/mixins/property-accessors.html b/lib/mixins/property-accessors.html index 94adfade87..a586f31a2d 100644 --- a/lib/mixins/property-accessors.html +++ b/lib/mixins/property-accessors.html @@ -91,12 +91,7 @@ * @summary Element class mixin for reacting to property changes from * generated property accessors. */ - Polymer.PropertyAccessors = Polymer.dedupingMixin( - /** - * @template T - * @param {function(new:T)} superClass - */ - function(superClass) { + Polymer.PropertyAccessors = Polymer.dedupingMixin(superClass => { /** * @polymerMixinClass diff --git a/lib/mixins/property-effects.html b/lib/mixins/property-effects.html index 523dfeaf14..74a740cb5c 100644 --- a/lib/mixins/property-effects.html +++ b/lib/mixins/property-effects.html @@ -1057,12 +1057,7 @@ * @summary Element class mixin that provides meta-programming for Polymer's * template binding and data observation system. */ - Polymer.PropertyEffects = Polymer.dedupingMixin( - /** - * @template T - * @param {function(new:T)} superClass - */ - function(superClass) { + Polymer.PropertyEffects = Polymer.dedupingMixin(superClass => { /** * @constructor diff --git a/lib/mixins/template-stamp.html b/lib/mixins/template-stamp.html index 170f4fe747..ddd58452e3 100644 --- a/lib/mixins/template-stamp.html +++ b/lib/mixins/template-stamp.html @@ -110,12 +110,7 @@ * @memberof Polymer * @summary Element class mixin that provides basic template parsing and stamping */ - Polymer.TemplateStamp = Polymer.dedupingMixin( - /** - * @template T - * @param {function(new:T)} superClass - */ - function(superClass) { + Polymer.TemplateStamp = Polymer.dedupingMixin(superClass => { /** * @polymerMixinClass diff --git a/lib/utils/boot.html b/lib/utils/boot.html index bb531ff36e..aefae138fe 100644 --- a/lib/utils/boot.html +++ b/lib/utils/boot.html @@ -36,7 +36,10 @@ // To be plugged by legacy implementation if loaded /** - * @param {Object} info + * @param {Object} info Prototype for the custom element. It must contain + * an `is` property to specify the element name. Other properties populate + * the element prototype. The `properties`, `observers`, `hostAttributes`, + * and `listeners` properties are processed to create element features. */ window.Polymer._polymerFn = function(info) { // eslint-disable-line no-unused-vars throw new Error('Load polymer.html to use the Polymer() function.');