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

loop within namespace fails w/ error: "Cannot call method 'concat' of undefined" #2001

Closed
busticated opened this issue May 10, 2014 · 2 comments

Comments

@busticated
Copy link

Using LESS v1.70 on node v0.10.28, this fails:

#example {
    .start(@col-count: 4){
         #example > .loop(@col-count);
    }

    .loop(@counter) when (@counter > 0) {
        .box-@{counter} {
            width: 100% / @counter;
        }
        #example > .loop((@counter - 1));
    }
}

#example > .start(); // LESS Syntax error : Cannot call method 'concat' of undefined

but this works fine:

// same namespace & mixin definitions shown above
div {
    #example > .start();
}

as does this:

.start(@col-count: 4){
    .loop(@col-count);
}

.loop(@counter) when (@counter > 0) {
    .box-@{counter} {
        width: 100% / @counter;
    }
    .loop((@counter - 1));
}

.start();

in LESS v1.6.x, all forms shown above worked fine, outputting the following:

.box-4 {
    width: 25%;
}
.box-3 {
    width: 33.333333333333336%;
}
.box-2 {
    width: 50%;
}
.box-1 {
    width: 100%;
}
@seven-phases-max
Copy link
Member

Thanks. Fixed with #2002.

@busticated
Copy link
Author

wow, nice job! 👏

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