From d55b9cb54adfa44630cc0530e33168f67010ac12 Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Mon, 22 Apr 2019 17:44:26 -0700 Subject: [PATCH] Fix a few closure compiler issues Fix spelling on some type annotations Remove documentation of unused `hasPath` argument for runComputedEffect Remove one spot calling runComputedEffect with unused `hasPath` argument --- lib/mixins/property-effects.js | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/lib/mixins/property-effects.js b/lib/mixins/property-effects.js index 9fe896cecc..1770585ac8 100644 --- a/lib/mixins/property-effects.js +++ b/lib/mixins/property-effects.js @@ -428,7 +428,7 @@ function runComputedEffects(inst, changedProps, oldProps, hasPaths) { } let info; while ((info = queue.shift())) { - if (runComputedEffect(inst, '', changedProps, oldProps, info, hasPaths)) { + if (runComputedEffect(inst, '', changedProps, oldProps, info)) { enqueueEffectsFor(info.methodInfo, computeEffects, queue, order, hasPaths); } } @@ -452,9 +452,9 @@ function runComputedEffects(inst, changedProps, oldProps, hasPaths) { /** * Inserts a computed effect into a queue, given the specified order. Performs * the insert using a binary search. - * + * * Used by `orderedComputed: true` computed property algorithm. - * + * * @param {Object} info Property effects metadata * @param {Array} queue Ordered queue of effects * @param {Map} order Map of computed property name->topological @@ -466,7 +466,7 @@ const insertEffect = (info, queue, order) => { let idx = -1; while (start <= end) { const mid = (start + end) >> 1; - // Note `methodInfo` is where the computed property name is stored in + // Note `methodInfo` is where the computed property name is stored in // the effect metadata const cmp = order.get(queue[mid].methodInfo) - order.get(info.methodInfo); if (cmp < 0) { @@ -487,14 +487,14 @@ const insertEffect = (info, queue, order) => { /** * Inserts all downstream computed effects invalidated by the specified property * into the topologically-sorted queue of effects to be run. - * + * * Used by `orderedComputed: true` computed property algorithm. - * + * * @param {string} prop Property name * @param {Object} computeEffects Computed effects for this element - * @param {Array} queue Topologically-sorted queue of computed effects + * @param {Array} queue Topologically-sorted queue of computed effects * to be run - * @param {Map} order Map of computed property name->topological + * @param {Map} order Map of computed property name->topological * sort order * @param {boolean} hasPaths True with `changedProps` contains one or more paths */ @@ -515,7 +515,7 @@ const enqueueEffectsFor = (prop, computeEffects, queue, order, hasPaths) => { /** * Generates and retrieves a memoized map of computed property name to its - * topologically-sorted order. + * topologically-sorted order. * * The map is generated by first assigning a "dependency count" to each property * (defined as number properties it depends on, including its method for @@ -531,8 +531,8 @@ const enqueueEffectsFor = (prop, computeEffects, queue, order, hasPaths) => { * * @param {!Polymer_PropertyEffects} inst The instance to retrieve the computed * effect order for. - * @return {Map} Map of computed property name->topological sort - * order + * @return {Map} Map of computed property name->topological sort + * order */ function getComputedOrder(inst) { let ordered = inst.constructor.__orderedComputedDeps; @@ -579,8 +579,8 @@ function dependencyCounts(inst) { const counts = {}; const ready = []; for (let p in props) { - const info = infoForComputed[p]; - if (info) { + const info = infoForComputed[p]; + if (info) { // Be sure to add the method name itself in case of "dynamic functions" counts[p] = info.args.length + (info.dynamicFn ? 1 : 0); } else { @@ -600,7 +600,6 @@ function dependencyCounts(inst) { * @param {?Object} changedProps Bag of current property changes * @param {?Object} oldProps Bag of previous values for changed properties * @param {?} info Effect metadata - * @param {boolean} hasPaths True with `changedProps` contains one or more paths * @return {boolean} True when the property being computed changed * @private */ @@ -2438,7 +2437,7 @@ export const PropertyEffects = dedupingMixin(superClass => { } const info = createMethodEffect(this, sig, TYPES.COMPUTE, runComputedEffect, property, dynamicFn); // Effects are normally stored as map of dependency->effect, but for - // ordered computation, we also need tree of computedProp->dependencies + // ordered computation, we also need tree of computedProp->dependencies ensureOwnEffectMap(this, COMPUTE_INFO)[property] = info; }