Index: tools/gn/functions.cc |
diff --git a/tools/gn/functions.cc b/tools/gn/functions.cc |
index 0a00c9cdbc1dbaa03b60ac4edd44fead7079bfbe..0102bd7f2da0ca85e4621d1a666845705fba00e0 100644 |
--- a/tools/gn/functions.cc |
+++ b/tools/gn/functions.cc |
@@ -1036,13 +1036,14 @@ Value RunFunction(Scope* scope, |
function_map.find(name.value()); |
if (found_function == function_map.end()) { |
// No built-in function matching this, check for a template. |
- const Template* templ = |
- scope->GetTemplate(function->function().value().as_string()); |
+ std::string template_name = function->function().value().as_string(); |
brucedawson
2016/07/14 17:39:26
Should be const std::string - or maybe const auto?
brettw
2016/07/14 19:26:38
I don't actually like "const" for local variables
|
+ const Template* templ = scope->GetTemplate(template_name); |
if (templ) { |
Value args = args_list->Execute(scope, err); |
if (err->has_error()) |
return Value(); |
- return templ->Invoke(scope, function, args.list_value(), block, err); |
+ return templ->Invoke(scope, function, template_name, args.list_value(), |
+ block, err); |
} |
*err = Err(name, "Unknown function."); |