mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Check value of elements before getting args
When parsing, mixin.call() doesn't need to look for mixin.args if there weren't any elements
This commit is contained in:
@@ -1091,17 +1091,20 @@ less.Parser = function Parser(env) {
|
||||
if (elements) { elements.push(elem); } else { elements = [ elem ]; }
|
||||
c = $char('>');
|
||||
}
|
||||
if ($char('(')) {
|
||||
args = this.args(true).args;
|
||||
expectChar(')');
|
||||
}
|
||||
|
||||
if (parsers.important()) {
|
||||
important = true;
|
||||
}
|
||||
if (elements) {
|
||||
if ($char('(')) {
|
||||
args = this.args(true).args;
|
||||
expectChar(')');
|
||||
}
|
||||
|
||||
if (elements && ($char(';') || peekChar('}'))) {
|
||||
return new(tree.mixin.Call)(elements, args, index, env.currentFileInfo, important);
|
||||
if (parsers.important()) {
|
||||
important = true;
|
||||
}
|
||||
|
||||
if (parsers.end()) {
|
||||
return new(tree.mixin.Call)(elements, args, index, env.currentFileInfo, important);
|
||||
}
|
||||
}
|
||||
|
||||
restore();
|
||||
@@ -1960,4 +1963,4 @@ less.Parser.serializeVars = function(vars) {
|
||||
}
|
||||
|
||||
return s;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user