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

Unified Diff: tools/gn/parse_tree.cc

Issue 439513003: Improve GN value origins for error messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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/parse_tree_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/parse_tree.cc
diff --git a/tools/gn/parse_tree.cc b/tools/gn/parse_tree.cc
index 00fca549b6902a1a46ceab608cd08d7a0b320e4d..59b39f36cee9d90f1f075b7e7022b62ba74b0c4a 100644
--- a/tools/gn/parse_tree.cc
+++ b/tools/gn/parse_tree.cc
@@ -373,12 +373,16 @@ const IdentifierNode* IdentifierNode::AsIdentifier() const {
}
Value IdentifierNode::Execute(Scope* scope, Err* err) const {
- const Value* result = scope->GetValue(value_.value(), true);
- if (!result) {
+ const Value* value = scope->GetValue(value_.value(), true);
+ Value result;
+ if (!value) {
*err = MakeErrorDescribing("Undefined identifier");
- return Value();
+ return result;
}
- return *result;
+
+ result = *value;
+ result.set_origin(this);
+ return result;
}
LocationRange IdentifierNode::GetRange() const {
« no previous file with comments | « no previous file | tools/gn/parse_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698