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

Unified Diff: tools/gn/template.cc

Issue 2187523003: Allow creation and modification of scopes in GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 4 years, 4 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 | « tools/gn/scope_unittest.cc ('k') | tools/gn/value.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/template.cc
diff --git a/tools/gn/template.cc b/tools/gn/template.cc
index e865264174a1740c7fe8a9821dd8d18f5764b84c..66d6745c96c6fe24df033032f77b0c575378fc92 100644
--- a/tools/gn/template.cc
+++ b/tools/gn/template.cc
@@ -80,8 +80,8 @@ Value Template::Invoke(Scope* scope,
// be avoided.
template_scope.SetValue(variables::kInvoker,
Value(nullptr, std::unique_ptr<Scope>()), invocation);
- Value* invoker_value =
- template_scope.GetMutableValue(variables::kInvoker, false);
+ Value* invoker_value = template_scope.GetMutableValue(
+ variables::kInvoker, Scope::SEARCH_NESTED, false);
invoker_value->SetScopeValue(std::move(invocation_scope));
template_scope.set_source_dir(scope->GetSourceDir());
@@ -108,7 +108,8 @@ Value Template::Invoke(Scope* scope,
// to overwrite the value of "invoker" and free the Scope owned by the
// value. So we need to look it up again and don't do anything if it doesn't
// exist.
- invoker_value = template_scope.GetMutableValue(variables::kInvoker, false);
+ invoker_value = template_scope.GetMutableValue(
+ variables::kInvoker, Scope::SEARCH_NESTED, false);
if (invoker_value && invoker_value->type() == Value::SCOPE) {
if (!invoker_value->scope_value()->CheckForUnusedVars(err))
return Value();
« no previous file with comments | « tools/gn/scope_unittest.cc ('k') | tools/gn/value.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698