(&mut self, name: Token<'gc>, mutability: Mutability)
| 1786 | } |
| 1787 | |
| 1788 | fn add_local(&mut self, name: Token<'gc>, mutability: Mutability) -> usize { |
| 1789 | if self.local_count == MAX_LOCALS { |
| 1790 | self.error_at(name, "Too many local variables in function."); |
| 1791 | return 0; |
| 1792 | } |
| 1793 | |
| 1794 | self.locals[self.local_count] = Local { |
| 1795 | name, |
| 1796 | depth: UNINITIALIZED_LOCAL_DEPTH, // Mark as uninitialized |
| 1797 | is_captured: false, |
| 1798 | mutability, |
| 1799 | }; |
| 1800 | let pos = self.local_count; |
| 1801 | self.local_count += 1; |
| 1802 | pos |
| 1803 | } |
| 1804 | |
| 1805 | fn mark_initialized(&mut self) { |
| 1806 | if self.scope_depth == 0 { |
no test coverage detected