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

Map keys are not evaluated #1086

Closed
OnkelTem opened this issue Apr 10, 2015 · 2 comments
Closed

Map keys are not evaluated #1086

OnkelTem opened this issue Apr 10, 2015 · 2 comments

Comments

@OnkelTem
Copy link

This code produces error

$map: (-1px: 12);

Error message:

  undefined:undefined  _Map_base::at

Also note 'undefined:undefined' standing for the line and column number — they are missed.

Using node-sass v3.0.0-beta.5 (pointing to libsass v3.2.0-beta.5)

I believe this temporary workaround can be used:

$minus1px: -1px;
$map: ($minus1px: 12);
@mgreter
Copy link
Contributor

mgreter commented Apr 10, 2015

This is actually not a regression, although that exact case was working before. The reason for this is, that things like the following did not work in libsass 3.1.0 either (which is the root bug for it):

$map: (0 - 1px: 12);
foo { bar: inspect($map); }

We changed the way we parse negative numbers to wrap them into an unary_operator. This is more in line with the actual meaning and solved problems in other places, but unfortunately brings up another problem to the surface here. IMO we need to evaluate the keys before "using" them.

@mgreter mgreter changed the title Can't use negative numbers as map keys Map keys are not evaluated Apr 10, 2015
@mgreter mgreter added this to the 3.2 milestone Apr 10, 2015
@mgreter mgreter self-assigned this Apr 10, 2015
@mgreter
Copy link
Contributor

mgreter commented Apr 11, 2015

This specific issue (and a few more) should be fixed by #1090. I'm quite sure that we have more subtile problems with map handlings, but this should at least fix quite a lot of the more common use-cases!

@mgreter mgreter closed this as completed Apr 11, 2015
mgreter added a commit to mgreter/sass-spec that referenced this issue Apr 22, 2016
mgreter added a commit to mgreter/sass-spec that referenced this issue Apr 22, 2016
mgreter added a commit to mgreter/sass-spec that referenced this issue Apr 22, 2016
mgreter added a commit to mgreter/sass-spec that referenced this issue Apr 22, 2016
mgreter added a commit to mgreter/sass-spec that referenced this issue Apr 22, 2016
mgreter added a commit to mgreter/sass-spec that referenced this issue Apr 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants