Index: tools/gn/loader.cc |
diff --git a/tools/gn/loader.cc b/tools/gn/loader.cc |
index 4cca2ce71b2805f5eeb9004a55cba0a0630c2853..32879ea63d3a3e513d9f0ce8054482da26c3deed 100644 |
--- a/tools/gn/loader.cc |
+++ b/tools/gn/loader.cc |
@@ -245,6 +245,9 @@ void LoaderImpl::BackgroundLoadFile(const Settings* settings, |
if (err.has_error()) |
g_scheduler->FailWithError(err); |
+ if (!our_scope.CheckForUnusedVars(&err)) |
+ g_scheduler->FailWithError(err); |
+ |
// Pass all of the items that were defined off to the builder. |
for (size_t i = 0; i < collected_items.size(); i++) |
settings->build_settings()->ItemDefined(collected_items[i]->Pass()); |
@@ -285,6 +288,11 @@ void LoaderImpl::BackgroundLoadBuildConfig( |
Err err; |
root_block->ExecuteBlockInScope(base_config, &err); |
+ // Clear all private variables left in the scope. We want the root build |
+ // config to be like a .gni file in that variables beginning with an |
+ // underscore aren't exported. |
+ base_config->RemovePrivateIdentifiers(); |
+ |
trace.Done(); |
if (err.has_error()) |