Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Unified Diff: tools/gn/functions.cc

Issue 2148093002: GN: Use the correct defaults for templates invoked via target(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/gn/functions_target.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.");
« no previous file with comments | « no previous file | tools/gn/functions_target.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698