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

Unified Diff: tools/gn/scope.cc

Issue 103593006: Allow GN imports to be processed from imports. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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/gn.gyp ('k') | tools/gn/scope_unittest.cc » ('j') | 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 052c55de3a7ac7fe763186f657980f4ce46a9a7b..3f714ec36d4664fd9865b348afdc67fa4b567c33 100644
--- a/tools/gn/scope.cc
+++ b/tools/gn/scope.cc
@@ -180,8 +180,9 @@ bool Scope::NonRecursiveMergeTo(Scope* dest,
Err* err) const {
// Values.
for (RecordMap::const_iterator i = values_.begin(); i != values_.end(); ++i) {
+ const Value& new_value = i->second.value;
const Value* existing_value = dest->GetValue(i->first);
- if (existing_value) {
+ if (existing_value && new_value != *existing_value) {
// Value present in both the source and the dest.
std::string desc_string(desc_for_err);
*err = Err(node_for_err, "Value collision.",
@@ -190,7 +191,7 @@ bool Scope::NonRecursiveMergeTo(Scope* dest,
"Which would clobber the one in your current scope"));
err->AppendSubErr(Err(*existing_value, "defined here.",
"Executing " + desc_string + " should not conflict with anything "
- "in the current\nscope."));
+ "in the current\nscope unless the values are identical."));
return false;
}
dest->values_[i->first] = i->second;
« no previous file with comments | « tools/gn/gn.gyp ('k') | tools/gn/scope_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698