Commit e7267cba by Aaron Leung

Making sure to evaluate a functions args even if it's just being passed through.

parent 929307e8
...@@ -291,8 +291,16 @@ namespace Sass { ...@@ -291,8 +291,16 @@ namespace Sass {
case Node::function_call: { case Node::function_call: {
// TO DO: default-constructed Function should be a generic callback (maybe) // TO DO: default-constructed Function should be a generic callback (maybe)
pair<string, size_t> sig(expr[0].token().to_string(), expr[1].size()); pair<string, size_t> sig(expr[0].token().to_string(), expr[1].size());
if (!f_env.count(sig)) return expr; // TO DO: EVAL THE ARGUMENTS if (!f_env.count(sig)) {
else return apply_function(f_env[sig], expr[1], prefix, env, f_env, new_Node, ctx); Node args(expr[1]);
for (size_t i = 0, S = args.size(); i < S; ++i) {
args[i] = eval(args[i], prefix, env, f_env, new_Node, ctx);
}
return expr;
}
else {
return apply_function(f_env[sig], expr[1], prefix, env, f_env, new_Node, ctx);
}
} break; } break;
case Node::unary_plus: { case Node::unary_plus: {
......
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