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

Bug with mixins using (...) and (@arguments) special variable #343

Open
twhoff opened this issue Apr 8, 2016 · 1 comment
Open

Bug with mixins using (...) and (@arguments) special variable #343

twhoff opened this issue Apr 8, 2016 · 1 comment

Comments

@twhoff
Copy link

twhoff commented Apr 8, 2016

Different behaviour in LESS and LESS4J, see following example:

CODE

.test {
    .test-base(arg1; arg2; arg3);
}

.test-base(...) {
    .test-1(@arguments);
    .test-2(@arguments);
    .test-3(@arguments);
    .test-4(@arguments);
}

// Extract from @arguments passed in as ... binder
.test-1(...) {
    len-check1: length(@arguments);
    test-extract1: extract(@arguments, 1);
}

// Extract from @arguments passed in with same name
.test-2(@arguments) {
    len-check2: length(@arguments);
    test-extract2: extract(@arguments, 1);
}

// Extract from @arguments passed in as @args
.test-3(@args) {
    len-check3: length(@args);
    test-extract3: extract(@args, 1);
}

// Extract from @arguments in parent scope
.test-4(@random) {
    len-check4: length(@arguments);
    test-extract4: extract(@arguments, 1);
}

OUTPUT LESS (correct)

.test {
  len-check1: 3;
  test-extract1: arg1;
  len-check2: 3;
  test-extract2: arg1;
  len-check3: 3;
  test-extract3: arg1;
  len-check4: 3;
  test-extract4: arg1;
}

OUTPUT LESS4J (incorrect)*

.test {
  len-check1: 1;
  test-extract1: arg1 arg2 arg3;
  len-check2: 3;
  test-extract2: arg1;
  len-check3: 3;
  test-extract3: arg1;
  len-check4: 1;
  test-extract4: arg1 arg2 arg3;
}

Test 1 and 4 fail in LESS4J.

@SomMeri
Copy link
Owner

SomMeri commented Apr 10, 2016

Thank you, I will have a look at this after #342.

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