Improper argument bug correction#8
Open
ggattoni wants to merge 5 commits intojonschlinkert:masterfrom
Open
Conversation
Fixed improper input parameter causing NaN wander around code. Added common base case for performance improvement. Fixed improper input parameter being negative and causing potential improper behaviour.
Added dependency
Now all tests pass. It should be stated somewhere in the documentation that the function repeat can accept a string as argument "num", it is not not very intuitive, and also can leads to problem if the string does not represent an integer. Now in that case a TypeError is thrown. It can also be passed as argument a negative integer and it does not make any sense actually, so now even in that case a TypeError is thrown. Added check for null and undefined cases, now needed due to the new check on argument num
Now repeat-string module is compatible with node v0.10/0.12
Added fix to missing Number.isInteger method in node v0.10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Corrected a bug in input parameter
When calling the function there was no check the number parameter being really a number. This bug fix use an appropriated ad hoc function to check that to reduce improper behaviour and NaN propagation.