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:
Josh Schmidt
2014-01-22 20:05:44 -07:00
parent e18b274f62
commit 815741acfb

View File

@@ -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;
};
};