Skip to content

Commit

Permalink
fix ArraySplice types to more closely match code
Browse files Browse the repository at this point in the history
There's a bunch of .length checks on the |current| and |previous| args
given to the public calculateSplices() method (which are duplicated when
these params are passed places).

I've updated from {Array} to {!Array} in every case that an unprotected
`.length` check occurs (which would fail if the parameter is `null`).
  • Loading branch information
danbeam committed Dec 20, 2017
1 parent 2719a9d commit f6182b3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/utils/array-splice.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,19 @@
* l: The length of the current array
* p: The length of the old array
*
* @param {Array} current The current "changed" array for which to
* @param {!Array} current The current "changed" array for which to
* calculate splices.
* @param {number} currentStart Starting index in the `current` array for
* which splices are calculated.
* @param {number} currentEnd Ending index in the `current` array for
* which splices are calculated.
* @param {Array} old The original "unchanged" array to compare `current`
* @param {!Array} old The original "unchanged" array to compare `current`
* against to determine splices.
* @param {number} oldStart Starting index in the `old` array for
* which splices are calculated.
* @param {number} oldEnd Ending index in the `old` array for
* which splices are calculated.
* @return {Array} Returns an array of splice record objects. Each of these
* @return {!Array} Returns an array of splice record objects. Each of these
* contains: `index` the location where the splice occurred; `removed`
* the array of removed items from this location; `addedCount` the number
* of items added at this location.
Expand Down Expand Up @@ -300,11 +300,11 @@
*
* @function
* @memberof Polymer.ArraySplice
* @param {Array} current The "changed" array for which splices will be
* @param {!Array} current The "changed" array for which splices will be
* calculated.
* @param {Array} previous The "unchanged" original array to compare
* @param {!Array} previous The "unchanged" original array to compare
* `current` against to determine the splices.
* @return {Array} Returns an array of splice record objects. Each of these
* @return {!Array} Returns an array of splice record objects. Each of these
* contains: `index` the location where the splice occurred; `removed`
* the array of removed items from this location; `addedCount` the number
* of items added at this location.
Expand Down

0 comments on commit f6182b3

Please sign in to comment.