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 with quoted keys as variable arguments #721

Closed
KittyGiraudel opened this issue Dec 11, 2014 · 3 comments · Fixed by #725
Closed

Map with quoted keys as variable arguments #721

KittyGiraudel opened this issue Dec 11, 2014 · 3 comments · Fixed by #725

Comments

@KittyGiraudel
Copy link

Test:

// Test 1
@mixin test($a, $b) {
  content: $a $b;
}

test {
  @include test(("a": 1, "b": 2)...);
}
// Test 2
@function test($a, $b) {
  @return $a $b;
}

test {
  content: test(("a": 1, "b": 2)...);
}

Expected result for both tests:

test {
  content: 1 2;
}

Results:

stdin:8: mixin test has no parameter named $"a"
stdin:8: function test has no parameter named $"a"
@KittyGiraudel
Copy link
Author

Okay, I have figured what's going on. It works when map keys are not quoted. If they are, it fails because it tries to fetch $"a" rather than $a... Nasty.

@KittyGiraudel KittyGiraudel changed the title Map as arguments Map with quoted keys as variable arguments Dec 11, 2014
@KittyGiraudel
Copy link
Author

We should probably update this spec to include some tests with quoted keys as well.

@KittyGiraudel
Copy link
Author

Added a spec: sass/sass-spec#171.

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

Successfully merging a pull request may close this issue.

3 participants