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

Don't crash when using Infinity or NaN as a key in a map #1073

Merged
merged 2 commits into from
Oct 27, 2020
Merged

Conversation

nex3
Copy link
Contributor

@nex3 nex3 commented Sep 4, 2020

Closes #3126
See sass/sass-spec#1556

@nex3 nex3 requested a review from Awjin September 4, 2020 22:21
@connorskees
Copy link
Contributor

Would it make sense to instead deny both NaN and Infinity from being map keys? That map-get(((0/0): a), (0/0)) is equal to null may be surprising to some. As this was already a crash, it should not break any existing code relying on dart-sass. In fact, denying NaN and Infinity as map keys may prevent silent errors that result from the disparity in equality between libsass and dart-sass (see sass/libsass#3126).

Copy link
Contributor

@Awjin Awjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with this workaround, and revisiting once floating point is officially defined in Sass.

@nex3 nex3 merged commit 300197c into master Oct 27, 2020
@nex3 nex3 deleted the weird-float-maps branch October 27, 2020 23:38
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.

3 participants