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

Unified Diff: tools/gn/scope.cc

Issue 2224343003: GN: Throw an error overwriting a nonempty scope. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment 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
« tools/gn/operators.cc ('K') | « tools/gn/scope.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/scope.cc
diff --git a/tools/gn/scope.cc b/tools/gn/scope.cc
index 7e7c201bbef918100225206b6ae107a6adc67f36..fbe73f448239661b4674537f2440363daf101f15 100644
--- a/tools/gn/scope.cc
+++ b/tools/gn/scope.cc
@@ -71,6 +71,11 @@ void Scope::DetachFromContaining() {
mutable_containing_ = nullptr;
}
+bool Scope::HasValues(SearchNested search_nested) const {
+ DCHECK(search_nested == SEARCH_CURRENT);
+ return !values_.empty();
+}
+
const Value* Scope::GetValue(const base::StringPiece& ident,
bool counts_as_used) {
// First check for programmatically-provided values.
« tools/gn/operators.cc ('K') | « tools/gn/scope.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698