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

Keywords should not show in arglist #1192

Closed
jakob-e opened this issue May 9, 2015 · 1 comment · Fixed by #1193
Closed

Keywords should not show in arglist #1192

jakob-e opened this issue May 9, 2015 · 1 comment · Fixed by #1193

Comments

@jakob-e
Copy link

jakob-e commented May 9, 2015

Ruby Sass and LibSass seems to be handling arglist and keywords quite differently.
I don't think the keyword function is supported by LibSass yet – but that aside
keywords should not show in the arglist.

The following tests were done on sassmeister using
LibSass 3.2.0-beta.6 and Ruby Sass 3.4.13

@mixin test($arglist...){
  /*#{inspect($arglist)}*/
}

// Works
@include test(foo, bar, baz);
// Ruby Sass:  /*foo, bar, baz*/ 
// LibSass  :  /*foo, bar, baz*/ 

// LibSass does not inspect as ()
@include test;
// Ruby Sass:  /*()*/                        
// LibSass  :  /**/  

// Ruby Sass throws error – LibSass shows keywords in arglist 
// (keywords should not show in arglist – see below) 
@include test(foo, bar, baz, $keyword: keyword);  
// Ruby Sass:  "Mixin test1 doesn't have an argument named $keyword." 
// LibSass  :  /*foo, bar, baz, $keyword: keyword*/

In order to test the last example in Ruby Sass we need to map the arglist using the keyword function.

@mixin test($arglist...){
  $map: keywords($arglist);
  /*#{inspect($map)}*/
  /*#{inspect($arglist)}*/
}

@include test(foo, bar, baz, $keyword: keyword);  
// Ruby Sass:  
// inspect($map)    : /*(keyword: keyword)*/
// inspect($arglist): /*foo, bar, baz*/*

// LibSass  :  
// inspect($map)    : /**/
// inspect($arglist): /*foo, bar, baz, $keyword: keyword*/


@mgreter mgreter self-assigned this May 10, 2015
@mgreter mgreter added this to the 3.2.4 milestone May 10, 2015
mgreter added a commit to mgreter/libsass that referenced this issue May 10, 2015
mgreter added a commit to mgreter/sass-spec that referenced this issue May 10, 2015
mgreter added a commit to mgreter/sass-spec that referenced this issue May 10, 2015
mgreter added a commit to mgreter/sass-spec that referenced this issue May 10, 2015
mgreter added a commit to mgreter/libsass that referenced this issue May 10, 2015
@xzyfer
Copy link
Contributor

xzyfer commented May 11, 2015

Specs added sass/sass-spec#372

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