Skip to main content

luaur_compiler/methods/
table_mutation_tracker_visit_constant_folding_alt_e.rs

1use crate::records::table_mutation_tracker::TableMutationTracker;
2use luaur_ast::records::ast_stat_compound_assign::AstStatCompoundAssign;
3use luaur_ast::records::ast_visitor::AstVisitor;
4
5impl<'a> TableMutationTracker<'a> {
6    pub fn visit_ast_stat_compound_assign(&mut self, node: *mut AstStatCompoundAssign) -> bool {
7        if node.is_null() {
8            return true;
9        }
10
11        unsafe {
12            let node_ref = &*node;
13
14            // LHS index expressions mutate the table
15            self.mark_escaped_table_index(node_ref.var, true);
16        }
17
18        true
19    }
20}