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

str-slice with $end-at should never return a value #762

Merged
merged 1 commit into from
Dec 26, 2014

Conversation

xzyfer
Copy link
Contributor

@xzyfer xzyfer commented Dec 26, 2014

This PR fixes an edge case with str-slice where $start-at == 1 and $end-at == 0 cause by they're normalisation.

Generally speaking str-slice should never return a value when $start-at > $end-at > 0. Our input validation is aware of this, but due to normalisation the case $start-at == 1 and $end-at == 0 gets normalised to $start-at == 0 and $end-at == 0.

Essentially we need to enforce $start-at > $end-at > 0 pre-normalisation.

Fixes #760. Specs added sass/sass-spec#194.

@xzyfer xzyfer force-pushed the fix/str-slice-end-at-0 branch from 8825415 to dc63805 Compare December 26, 2014 02:48
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling dc63805 on xzyfer:fix/str-slice-end-at-0 into cf7c1d1 on sass:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling dc63805 on xzyfer:fix/str-slice-end-at-0 into cf7c1d1 on sass:master.

xzyfer added a commit that referenced this pull request Dec 26, 2014
`str-slice` with `$end-at: `0 should never return a value
@xzyfer xzyfer merged commit fd3cc88 into sass:master Dec 26, 2014
@xzyfer xzyfer added this to the 3.1 milestone Dec 26, 2014
@xzyfer xzyfer deleted the fix/str-slice-end-at-0 branch January 7, 2015 05:56
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.

str-slice is returning the wrong value when $start-at is 1 and $end-at is 0
2 participants