mirror of
https://github.com/less/less.js.git
synced 2026-05-01 03:00:22 -04:00
Expressions require a delimiter of some kind in mixin args
This commit is contained in:
@@ -932,7 +932,7 @@ var Parser = function Parser(context, imports, fileInfo) {
|
||||
returner = { args:null, variadic: false },
|
||||
expressions = [], argsSemiColon = [], argsComma = [],
|
||||
isSemiColonSeparated, expressionContainsNamed, name, nameLoop,
|
||||
value, arg, expand;
|
||||
value, arg, expand, hasSep = true;
|
||||
|
||||
parserInput.save();
|
||||
|
||||
@@ -953,7 +953,7 @@ var Parser = function Parser(context, imports, fileInfo) {
|
||||
arg = entities.variable() || entities.property() || entities.literal() || entities.keyword() || this.call(true);
|
||||
}
|
||||
|
||||
if (!arg) {
|
||||
if (!arg || !hasSep) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1019,10 +1019,12 @@ var Parser = function Parser(context, imports, fileInfo) {
|
||||
argsComma.push({ name:nameLoop, value:value, expand:expand });
|
||||
|
||||
if (parserInput.$char(',')) {
|
||||
hasSep = true;
|
||||
continue;
|
||||
}
|
||||
hasSep = parserInput.$char(';') === ';';
|
||||
|
||||
if (parserInput.$char(';') || isSemiColonSeparated) {
|
||||
if (hasSep || isSemiColonSeparated) {
|
||||
|
||||
if (expressionContainsNamed) {
|
||||
error('Cannot mix ; and , as delimiter types');
|
||||
|
||||
7
test/less/errors/mixin-not-defined-2.less
Normal file
7
test/less/errors/mixin-not-defined-2.less
Normal file
@@ -0,0 +1,7 @@
|
||||
.non-matching-mixin(@a @b) {
|
||||
args: @a @b;
|
||||
}
|
||||
|
||||
x {
|
||||
.non-matching-mixin(x, y);
|
||||
}
|
||||
4
test/less/errors/mixin-not-defined-2.txt
Normal file
4
test/less/errors/mixin-not-defined-2.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
RuntimeError: No matching definition was found for `.non-matching-mixin(x, y)` in {path}mixin-not-defined-2.less on line 6, column 3:
|
||||
5 x {
|
||||
6 .non-matching-mixin(x, y);
|
||||
7 }
|
||||
Reference in New Issue
Block a user