feat: lookup at downgrade time
works, but leaks memory
This commit is contained in:
@@ -2,11 +2,10 @@ use std::ops::Deref;
|
||||
use std::rc::Rc;
|
||||
|
||||
use derive_more::Constructor;
|
||||
use gc_arena::{Collect, Gc, Mutation};
|
||||
use gc_arena::Collect;
|
||||
use hashbrown::{HashMap, HashSet};
|
||||
use itertools::Itertools;
|
||||
|
||||
use crate::env::VmEnv;
|
||||
use crate::vm::VM;
|
||||
|
||||
use super::super::public as p;
|
||||
@@ -58,14 +57,6 @@ impl<'gc> AttrSet<'gc> {
|
||||
self.data.get(&sym).is_some()
|
||||
}
|
||||
|
||||
pub fn capture(&mut self, env: Gc<'gc, VmEnv<'gc>>, mc: &Mutation<'gc>) {
|
||||
self.data.iter().for_each(|(_, v)| {
|
||||
if let Value::Thunk(ref thunk) = v.clone() {
|
||||
thunk.capture_env(env, mc);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
pub fn update(&mut self, other: &AttrSet<'gc>) {
|
||||
for (k, v) in other.data.iter() {
|
||||
self.push_attr_force(*k, v.clone())
|
||||
|
||||
Reference in New Issue
Block a user