OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "tools/gn/functions.h" | 5 #include "tools/gn/functions.h" |
6 | 6 |
7 #include <iostream> | 7 #include <iostream> |
8 | 8 |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 if (found_function->second.executed_block_runner) { | 732 if (found_function->second.executed_block_runner) { |
733 if (!block) { | 733 if (!block) { |
734 FillNeedsBlockError(function, err); | 734 FillNeedsBlockError(function, err); |
735 return Value(); | 735 return Value(); |
736 } | 736 } |
737 | 737 |
738 Scope block_scope(scope); | 738 Scope block_scope(scope); |
739 block->ExecuteBlockInScope(&block_scope, err); | 739 block->ExecuteBlockInScope(&block_scope, err); |
740 if (err->has_error()) | 740 if (err->has_error()) |
741 return Value(); | 741 return Value(); |
742 return found_function->second.executed_block_runner( | 742 |
| 743 Value result = found_function->second.executed_block_runner( |
743 function, args.list_value(), &block_scope, err); | 744 function, args.list_value(), &block_scope, err); |
| 745 |
| 746 if (!block_scope.CheckForUnusedVars(err)) |
| 747 return Value(); |
| 748 return result; |
744 } | 749 } |
745 | 750 |
746 // Otherwise it's a no-block function. | 751 // Otherwise it's a no-block function. |
747 return found_function->second.no_block_runner(scope, function, | 752 return found_function->second.no_block_runner(scope, function, |
748 args.list_value(), err); | 753 args.list_value(), err); |
749 } | 754 } |
750 | 755 |
751 } // namespace functions | 756 } // namespace functions |
OLD | NEW |