less4j
less4j copied to clipboard
Bug with mixins using (...) and (@arguments) special variable
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.
Thank you, I will have a look at this after #342.