Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Use of nth() on appended variable-length arglist never finishes compiling #930

Closed
davidkpiano opened this issue May 7, 2015 · 2 comments

Comments

@davidkpiano
Copy link

See below for issue:

@function foo($initial, $args...) {
    $args: append($args, 3);

    @return nth($args, 1);
}

@debug foo(1, 2);

// EXPECTED: 2

// ACTUAL (Ruby Sass v.3.4.13): 2
// ACTUAL (Node Sass v.3.0.0 and lower): << never finishes compiling, no output >>
@davidkpiano
Copy link
Author

Also, potentially related - an appended variable-length arglist should have an accurate length given by length()

@function foo($initial, $args...) {
    $args: append($args, 3);

    @return bar($initial, $args...);
}

@function bar($args...) {
    @debug $args; // DEBUG: 1, 2, 3 
                  // (in both node-sass and Ruby Sass)

    @return length($args);
}

@debug foo(1, 2);

// EXPECTED: 3

// ACTUAL (Ruby Sass v.3.4.13): 3
// ACTUAL (Node Sass v.3.0.0 and lower): 2

@davidkpiano
Copy link
Author

Moved to sass/libsass#1171

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

No branches or pull requests

1 participant