jsdoc icon indicating copy to clipboard operation
jsdoc copied to clipboard

BUG: Fixed length check, after slpice(), `l` was wrong

Open AlexisWilke opened this issue 5 years ago • 0 comments

Q A
Bug fix? yes
New feature? no
Breaking change? no
Deprecations? no
Tests added? no
Fixed issues n.a.
License Apache-2.0

The for() loop was setting l as the length of the array. Then within the array you splice() it whenever a filename gets removed. l is now the wrong length. I suggest we simply use the sourceFiles.length so that way it works as expected. We could also reduce l each time a splice() happens.

To test, I used a console.log(sourceFile) inside the loop and I have a README.md file in my package directory. That means a splice() occurs and you see an undefined in your console for the last i which is larger than sourceFiles.length.

AlexisWilke avatar Dec 31 '18 01:12 AlexisWilke