Index: tools/gn/functions.h |
diff --git a/tools/gn/functions.h b/tools/gn/functions.h |
index 9668658ac626922fe581e81f78eba01fdf1c4a92..0c977002285a76c0177e745606bd04f146e19547 100644 |
--- a/tools/gn/functions.h |
+++ b/tools/gn/functions.h |
@@ -416,6 +416,16 @@ Value RunFunction(Scope* scope, |
// Helper functions ----------------------------------------------------------- |
+// Validates that the scope that a value is defined in is not the scope |
+// of the current declare_args() call, if that's what we're in. It is |
+// illegal to read a value from inside the same declare_args() call, since |
+// the overrides will not have been applied yet (see `gn help declare_args` |
+// for more). |
+bool EnsureNotReadingFromSameDeclareArgs(const ParseNode* node, |
+ const Scope* cur_scope, |
+ const Scope* val_scope, |
+ Err* err); |
+ |
// Verifies that the current scope is not processing an import. If it is, it |
// will set the error, blame the given parse node for it, and return false. |
bool EnsureNotProcessingImport(const ParseNode* node, |
@@ -464,7 +474,7 @@ Label MakeLabelForScope(const Scope* scope, |
const FunctionCallNode* function, |
const std::string& name); |
-// Some tyesp of blocks can't be nested inside other ones. For such cases, |
+// Some types of blocks can't be nested inside other ones. For such cases, |
// instantiate this object upon entering the block and Enter() will fail if |
// there is already another non-nestable block on the stack. |
class NonNestableBlock { |