Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix String.endsWith returning false negatives #155

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dengjeffrey
Copy link

@dengjeffrey dengjeffrey commented Jan 5, 2019

What does this PR try to solve:

Previous implementation of String.endsWith(str, substr) returns false if the the string provided contained more than one instance of the substring.

This PR tries to solve this problem by comparing the suffix of the original string against the substring the user is looking for.

This PR does not use String.endsWith added in ECMA6, so that targaryen is still compatible with node 4

Testing

Added edge case test to string-methods.js test spec

@coveralls
Copy link

coveralls commented Jan 7, 2019

Coverage Status

Coverage increased (+0.004%) to 95.408% when pulling 5a6c697 on dengjeffrey:fix/string-endsWith into e4151e7 on goldibex:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants