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

Buggy `String#endsWith` with `position` argument #168

Closed
mathiasbynens opened this Issue Dec 17, 2013 · 0 comments

Comments

Projects
None yet
1 participant
@mathiasbynens
Contributor

mathiasbynens commented Dec 17, 2013

This implementation fails the following tests taken from https://github.com/mathiasbynens/String.prototype.endsWith/blob/master/tests/tests.js:

assertEquals('abc'.endsWith('b', -1), false);
assertEquals('abc'.endsWith('ab', -1), false);

There’s also this issue:

assertThrows(function() { '[a-z]+(bar)?'.endsWith(/(bar)?/); }, TypeError);
assertThrows(function() { '[a-z]+(bar)?'.endsWith(/(bar)?/); }, TypeError);
assertThrows(function() { '[a-z]+/(bar)?/'.endsWith(/(bar)?/); }, TypeError);

…but that’s covered in #167.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment