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

Unified Diff: tools/gn/functions.cc

Issue 399143006: Check for unused variables in GN. (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 | « third_party/yasm/BUILD.gn ('k') | no next file » | 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 e973f2ee5c3d0d89e9f985131301640e50028705..35e42d44e98a739179ab0a4e474f4c2c64dd97f3 100644
--- a/tools/gn/functions.cc
+++ b/tools/gn/functions.cc
@@ -739,8 +739,13 @@ Value RunFunction(Scope* scope,
block->ExecuteBlockInScope(&block_scope, err);
if (err->has_error())
return Value();
- return found_function->second.executed_block_runner(
+
+ Value result = found_function->second.executed_block_runner(
function, args.list_value(), &block_scope, err);
+
+ if (!block_scope.CheckForUnusedVars(err))
+ return Value();
+ return result;
}
// Otherwise it's a no-block function.
« no previous file with comments | « third_party/yasm/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698