fix(es/ast): Prevent mutable reference escape (#12088)