Skip to content

Commit

Permalink
Fix a few closure compiler issues
Browse files Browse the repository at this point in the history
Fix spelling on some type annotations
Remove documentation of unused `hasPath` argument for runComputedEffect
Remove one spot calling runComputedEffect with unused `hasPath` argument
  • Loading branch information
dfreedm committed Apr 23, 2019
1 parent 084e479 commit d55b9cb
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions lib/mixins/property-effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand All @@ -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<Object>} queue Ordered queue of effects
* @param {Map<string,number>} order Map of computed property name->topological
Expand All @@ -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) {
Expand All @@ -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<Obbject>} queue Topologically-sorted queue of computed effects
* @param {Array<Object>} queue Topologically-sorted queue of computed effects
* to be run
* @param {Map<string,numer>} order Map of computed property name->topological
* @param {Map<string,number>} order Map of computed property name->topological
* sort order
* @param {boolean} hasPaths True with `changedProps` contains one or more paths
*/
Expand All @@ -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
Expand All @@ -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<string,numbber>} Map of computed property name->topological sort
* order
* @return {Map<string,number>} Map of computed property name->topological sort
* order
*/
function getComputedOrder(inst) {
let ordered = inst.constructor.__orderedComputedDeps;
Expand Down Expand Up @@ -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 {
Expand All @@ -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
*/
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit d55b9cb

Please sign in to comment.