Commit f8309b5a by Aaron Leung

Checking that the right number of arguments are passed.

parent 22059711
......@@ -347,7 +347,12 @@ namespace Sass {
}
}
else {
// TO DO: ensure (j < params.size())
// ensure that the number of ordinal args < params.size()
if (j >= params.size()) {
stringstream ss;
ss << "mixin " << mixin[0].to_string("") << " only takes " << params.size() << ((params.size() == 1) ? " argument" : " arguments");
eval_error(ss.str(), args[i].line_number, args[i].file_name);
}
Node param(params[j]);
Token name(param.type == Node::variable ? param.content.token : param[0].content.token);
bindings[name] = eval(args[i], env, f_env);
......
......@@ -37,5 +37,5 @@ $y: hey;
}
div {
@include foo($x: ho, goo, hey, boo);
@include foo(blah, $x: ho, goo);
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment