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

Arglist passed as single argument for varargs improperly getting destructured #1645

Closed
davidkpiano opened this issue Oct 27, 2015 · 9 comments

Comments

@davidkpiano
Copy link

Naming issues is hard.

TEST:

@function foo($a, $should-be-empty...) {
  @return length($should-be-empty);
}

@function bar($args...) {
  @return call(foo, $args...);
}

@function args($args...) {
  @return $args;
}

$a: args(1, 2, 3);

test {
  test: bar($a);
}

EXPECTED:

test {
  test: 0;
}

ACTUAL: (LibSass 3.3.1)

test {
  test: 2;
}
@davidkpiano
Copy link
Author

@mgreter I think your example works as expected because you're only passing in one argument to args(), instead of three, as in the previous example.

@mgreter
Copy link
Contributor

mgreter commented Oct 27, 2015

yep, saw it too, thought nobody had seen it yet, already removed it ... need to do more tests.

@mirisuzanne
Copy link

I just ran into this issue today, and wonder if it's the same thing?

$function: 'hsl';
$hue: 360;
$value: (30%, 40%);

.test {
  // This doesn't work in libsass (works in ruby sass)
  background-color: call($function, $hue, $value...);

  // This works great
  $call: join(($function, $hue), $value);
  color: call($call...);
}

// ERROR: required parameter $lightness is missing in call to function hsl on line 7 at column 21

@xzyfer
Copy link
Contributor

xzyfer commented Nov 19, 2015

Quiet possibly. I'm working on this fix. It'll be in the next release.
On 20 Nov 2015 6:16 am, "E. Miriam Suzanne" [email protected]
wrote:

I just ran into this issue today
http://sassmeister.com/gist/06cc198106af785c61f9, and wonder if it's
the same thing?

$function: 'hsl';$hue: 360;$value: (30%, 40%);
.test { // This doesn't work in libsass (works in ruby sass)
background-color: call($function, $hue, $value...);
// This works great
$call: join(($function, $hue), $value);
color: call($call...);
}
// ERROR: required parameter $lightness is missing in call to function hsl on line 7 at column 21


Reply to this email directly or view it on GitHub
#1645 (comment).

@xzyfer
Copy link
Contributor

xzyfer commented Dec 1, 2015

Spec added sass/sass-spec#621

xzyfer added a commit to xzyfer/sass-spec that referenced this issue Dec 30, 2015
@xzyfer
Copy link
Contributor

xzyfer commented Dec 30, 2015

I have a passing branch for this. It's not pretty but it works for now. I've decided to extend this issue encompass "sassdash test suite passing".

All sassdash tests that aren't segfaulting are passing. I think most of the segfaults are due to #1813 so I think we're close.

xzyfer added a commit to xzyfer/libsass that referenced this issue Dec 30, 2015
@xzyfer xzyfer self-assigned this Dec 30, 2015
xzyfer added a commit to xzyfer/libsass that referenced this issue Dec 30, 2015
xzyfer added a commit to xzyfer/libsass that referenced this issue Dec 30, 2015
@xzyfer
Copy link
Contributor

xzyfer commented Dec 30, 2015

I know it's been a while @mirisuzanne but the usecase you reported last month is also covered by this patch.

@mirisuzanne
Copy link

@xzyfer I'm seeing this error again, but only when I call core Sass functions. With custom functions, it works great. Here's a demo showing it successful with a custom function, and again with the hack listed above – but failing (in libsass only) if you unquote the call with a core function:

https://www.sassmeister.com/gist/cd09d650328b8f486a5d3b31c3009225

@mgreter
Copy link
Contributor

mgreter commented Aug 22, 2017

@mirisuzanne could you please create a separate issue and if possible a spec test. Looking at the code and inspecting the AST I believe this specific case has never worked in any previous libsass versions. Thanks.

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

5 participants